求助一下高手
#include<iostream.h>#include<string.h>
class student
{private:char *Name;
int Number;
int Mathscore;
int Engscore;
int Physcore;
int Cplusscore;
public:void registers(char *name,int number,int mathscore,int engscore,int physcore,int cplusscore)
{strcpy(Name,name);
Number=number;
Mathscore=mathscore;
Engscore=engscore;
Physcore=physcore;
Cplusscore=cplusscore;
}
void print()
{cout<<"你的名字是:"<<Name<<endl;
cout<<"学号是:"<<Number;
cout<<"你的各门分数分别是:"<<"数学:"<<Mathscore<<",英语:"<<Engscore<<",物理:"<<Physcore<<",c++:"<<Cplusscore<<endl;
};};
void main(void)
{student surivering;
surivering.registers("李明",041630,80,80,80,80);
surivering.print();}
程序编译通过了,执行时有错误,我觉得是因为我的*name 指针没有初始化,应该怎么初始化啊