作为新手的我,找不到错误(友元函数)
作为新手的我 找不到错误!!#include<iostream>
using namespace std;
class girl
{
private:
char *name;
int age;
friend boy;
};
class boy
{
public:
void disp(girl&x);
};
void boy::disp(girl&x)
{
x.age = 20;
cout << age;
}
int main()
{
girl aa;
void disp(aa);
cin.get();
return 0;
}