33,311
社区成员
发帖
与我相关
我的任务
分享
show s1;
show* sp=&s1;
// test example 1
cout<< *sp.test <<endl;
*sp.showtest();
// test example 2
cout<< sp->test <<endl;
sp->showtest();
// test example 3
cout<<s1.test<<endl;
s1.showtest();
// The upper 3 examples are the same.
//*******
class show
{
public:
//...........
type showtest() const;
//private: // In order to make it an example, make it public.
int test;
};
//............
show s1;
show* sp=&s1;
// test example 1
cout<< *sp.test <<endl;
*sp.showtest();
// test example 2
cout<< sp->test <<endl;
sp->showtest();
// The upper two examples are the same.
//............