老師厲害,不錯,講的真心好,上課上了好幾周沒聽懂,今天一晚上就感覺學(xué)到了一個學(xué)期東西。我一直很努力,可是才發(fā)現(xiàn),努力并不是最重要的,關(guān)鍵在于效率和方法啊,慕課網(wǎng)真的很好,很感激。希望越做越大,越做越卓越!
2018-04-29
這下邊哪里錯了么
void Student::setName(string _name)
{
m_strName = _name;
}
string Student:: getName()
{
return m_strName;
}
int main(void)
{
Student *stu=new Student;
stu->setName("mukewang");
cout << stu->setName() << endl;
delete stu;
stu =NULL;
return 0;
}
void Student::setName(string _name)
{
m_strName = _name;
}
string Student:: getName()
{
return m_strName;
}
int main(void)
{
Student *stu=new Student;
stu->setName("mukewang");
cout << stu->setName() << endl;
delete stu;
stu =NULL;
return 0;
}
2018-04-24
int main(void)
{
// 通過new方式實例化對象*stu
Student *stu = new Student();
// 更改對象的數(shù)據(jù)成員為“慕課網(wǎng)”
stu->setName("慕課網(wǎng)");
// 打印對象的數(shù)據(jù)成員
cout << stu->getName() << endl;
delete stu;
stu = NULL;
system("pause");
}
{
// 通過new方式實例化對象*stu
Student *stu = new Student();
// 更改對象的數(shù)據(jù)成員為“慕課網(wǎng)”
stu->setName("慕課網(wǎng)");
// 打印對象的數(shù)據(jù)成員
cout << stu->getName() << endl;
delete stu;
stu = NULL;
system("pause");
}
2018-04-24
class Student
{
public:
void student() {};
string student(string _name) {};
string student(const Student& stu){};
~Student() {};
void setName(string _name)
{
m_strName = _name;
}
string getName()
{
return m_strName;
}
private:
string m_strName;
};
{
public:
void student() {};
string student(string _name) {};
string student(const Student& stu){};
~Student() {};
void setName(string _name)
{
m_strName = _name;
}
string getName()
{
return m_strName;
}
private:
string m_strName;
};
2018-04-24