class student
{ public: student(char*pName,int xHours,float xgpa) { cout<<"constucting student.\n"<<pName<<endl; strcpy(name,pName,sizeof(name)); name[sizeof(name)-1]="\0\"; semesHours=xHours; gpa=xgpa; } ~student() { cout<<"destructing student.\n"<<name<<endl; } protected: char*name; int*semesHours; float*gpa; }; void main() { student ss("Jenny",22,3.5); }
--------------------Configuration: xueshenglei - Win32 Debug-------------------- Compiling... xueshenglei.cpp D:\MSDev98\MyProjects\xueshenglei\xueshenglei.cpp(14) : error C2001: newline in constant 执行 cl.exe 时出错. xueshenglei.exe - 1 error(s), 0 warning(s)
|
|