关于运算符重载的一道改错题
#include<iostream>using namespace std;
class Student{
private:
char *name;
int age;
double Money;
public:
Student(char *n="Noknow",int Age=17,
double Mey=10000):age(Age),Money(Mey){
name=new char[sizeof(n)+1];
strcpy(name,n);
}
oprator char *(){return name;}
oprator int (){return age;}
oprator double (){return Money;}
};
void main()
Student s1("丽贝卡",19,2880);
char *Name=s1;
int Age=s1;
double Money;
cout<<Name<<"\t"<<Age<<"\t"<<Money<<endl;
Student s2("马克");
char *Name =s2;
int Age=s2;
double Money=s2;
cout<<Name<<"\t"<<Age<<"\t"<<Money<<endl;
初学c++,看不懂书上的理论,请各位帮我看看错误在哪里