调用类的三种方式

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;

  

 

posted @ 2017-05-05 16:29  白色的回忆  阅读(438)  评论(0编辑  收藏  举报