在codeblocks中結(jié)果正確但是提交上去就是不對哪兒錯了?
#include <iostream>
#include<string>
using namespace std;
class Student
{
public:
? ? Student(){
? ? m_strName=" ";}
? ? Student(string _name)
? ? {
? ? ? ? m_strName=_name;
? ? }
? ?Student(const Student& stu);
? ?~Student();
? ?void setName(string _name)
? ?{
? ? ? ?m_strName=_name;
? ?}
? ?string getName()
? ?{
? ? ? ?return m_strName;
? ?}
private:
? ? string m_strName;
};
int main()
{
? ? Student *stu=new Student();
? ? stu->setName("慕課網(wǎng)");
? ? cout<<stu->getName()<<endl;
return 0;
}
2017-04-03
2016-12-05
析構(gòu)函數(shù)沒有實現(xiàn)
~Student() { };
2016-11-08