无效的非静态成员,,,求大神 求解
#include<iostream>#include<string>
using namespace std;
struct PersonData
{
string name;
PersonData*child;
PersonData*bor;
};
class FamilyTree
{
public:
FamilyTree()
{
Ancestor=new PersonData;
cout<<"请输入祖先的名字\n";
cin>>Ancestor->name;
}
void CreatPerson(PersonData*person=Ancestor);
bool Getinfo(PersonData*);
void disPlay(PersonData*person=Ancestor);//输出全部成员信息
public:
PersonData*Ancestor;
};
编译出现“error: invalid use of non-static data member 'FamilyTree::Ancestor'|”的错误,,不知道怎么搞的,,,