这个程序的错误怎么修改呢?大家帮忙看看,这个错误没见过
#include<iostream.h>#include<string.h>
class student
{
private:
int age;
char sex;
char *name;
public:
student(int a,char s,char *p_name);
~student
{
delete name;
}
void show();
{
cout<<name<<endl;
}
};
student::student(int a,char s,char *p_name)
{
age=a;
sex=s;
int length=sizeof(p_name);
name=new char[length+1];
strcpy(name,p_name)
}
void main()
{
char *pp="abcd";
int a=2;
char s='m';
student st(a,s,pp);
st.show();
}