#include <iostream.h>
class student
{public:
int no;
void show(){
cout <<"no="<<no<<endl;}
};
int main()
{
student s1;//对象
s1.no=1;
s1.show();
student & x=s1;//引用
x.no=4;
x.show();
student * p=&s1;//指针
p->no=2;
p->show();
(*p).no=3;//指针内容
(*p).show();
return 0;
}
class student
{public:
int no;
void show(){
cout <<"no="<<no<<endl;}
};
int main()
{
student s1;//对象
s1.no=1;
s1.show();
student & x=s1;//引用
x.no=4;
x.show();
student * p=&s1;//指针
p->no=2;
p->show();
(*p).no=3;//指针内容
(*p).show();
return 0;
}