#include <iostream>
#include <string>
using namespace std;

class student
{
private:
char name[20];
public:
student(const char* str)
{
strcpy(name,str);
}
void get()
{
cout<<name<<endl;
}
void make(const student &pre)
{
cout<<pre.name<<endl;
}
};

int main()
{
student A("jianghuihong");
A.get();

student B("wangjun");
A.make(B);
/*输出
jianghuihong
wangjun
Press any key to continue

说明相同类型的对象是可以互相访问私有成员的

*/
return 0;
}