vc++6.0能過(guò),這里不能
#include <iostream>
#include <string>
using namespace std;
class Student
{
? ? public:
Student(){m_strName="";}
Student(string _name){m_strName=_name;}
Stduent(const Student&stu){};
~Student(){};
void setName(string _name)
{m_strName=_name;}
string getName()
{return m_strName;}
? ? private:
string m_strName;
};
int main(void)
{
? ? Student *stu = new Student;
? ? if(stu==NULL)
? ? return 0;
stu->setName("慕課網(wǎng)");
cout<<stu->getName()<<endl;
? ? delete stu;
? ? stu=NULL;
return 0;
}
warning: no newline at end of file
error: ISO C++ forbids declaration of 'Stduent' with no type
2015-07-30
打代碼的時(shí)候請(qǐng)認(rèn)真點(diǎn),還有VC6.0估計(jì)也不能過(guò)