class Student
{
public:
string setName(string _name)
{m_strName = _name;
return m_strName;}
string getName()
{return m_strName;}
private:
string m_strName;
};
int main()
{Student *str = new Student();
str->setName("慕課網");
cout << str->getName();
delete str;
str = NULL;
system("pause");
return 0;}
{
public:
string setName(string _name)
{m_strName = _name;
return m_strName;}
string getName()
{return m_strName;}
private:
string m_strName;
};
int main()
{Student *str = new Student();
str->setName("慕課網");
cout << str->getName();
delete str;
str = NULL;
system("pause");
return 0;}
class student
{
public:
string Name;
int age;
};
int main()
{
student coor;
coor.Name= "慕課網";
coor.age=21;
cout << "student's name is " <<"慕課網" << endl << "age is " << 21<< endl;
system ("pause");
return 0;
}
{
public:
string Name;
int age;
};
int main()
{
student coor;
coor.Name= "慕課網";
coor.age=21;
cout << "student's name is " <<"慕課網" << endl << "age is " << 21<< endl;
system ("pause");
return 0;
}