1. 程式人生 > >調用類的三種方式

調用類的三種方式

set div sharp csharp true ren light setname clas

1.T t;

Teacher teach ;//T  t = new T t();
teach.SetName("lizl");
teach.Say();

2 *t

Teacher *b=&teach ;
b->SetName("rename");
b->Say();

3.&t

Teacher &c=teach;
c.Say();
cout<< b <<endl;

  

調用類的三種方式