#include<iostream.h>
#include<string.h>
class Student
{
int age;
char *name;
public:
static int count;
Student::Student(int m,char *n)
{
age=m;
strcpy(name,n);
count++;
}
Student::Student()
{
age=0;
name="NoName";
count++;
}
Student::~Student()
{
count--;
}
char* Student::GetName()
{
return name;
}
int Student::GetAge()
{
return age;
}
void Student::Print()const
{
cout<<count<<endl;
cout<<"name="<<name<<" ";
cout<<"age="<<age<<endl;
}
};
int Student::count=0;
int main()
{
cout<<"Count="<<Student::count<<endl;
Student s1,*p=new Student(23,"ZhangHong");
s1.Print();
p->Print();
delete p;
s1.Print();
Student Stu[4];
cout<<"Count="<<Student::count<<endl;
return 0;
}
这个程序有什么问题?求解答