最赞回答 / 伊兮尘昔
void Teacher::setGender(string _gender); string Teacher::getGender();string Teacher::getName();这三句话后面的分号是几个意思?
2015-09-09
class student
{
public:
string m_strName;
int m_iAge;
};
int main()
{
student stu;
stu.m_strName = "慕课网";
stu.m_iAge = 2;
cout << "student's name is " + stu.m_strName << endl << "age is " << stu.m_iAge << endl;
return 0;
}
{
public:
string m_strName;
int m_iAge;
};
int main()
{
student stu;
stu.m_strName = "慕课网";
stu.m_iAge = 2;
cout << "student's name is " + stu.m_strName << endl << "age is " << stu.m_iAge << endl;
return 0;
}
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
大家看这里啊!有错误!!!希望能即使更正!!!!!!!!!!!!!!!!!!!!!!!!!!!!
代码应该是这样得!
int main(void)
{
TV *p = new TV[5];
for (int i = 0; i < 5; i++)
{
p[i].type = 0;
p[i].changeVol();
}
delete []p;
p = NULL;
return 0;
}
大家看这里啊!有错误!!!希望能即使更正!!!!!!!!!!!!!!!!!!!!!!!!!!!!
代码应该是这样得!
int main(void)
{
TV *p = new TV[5];
for (int i = 0; i < 5; i++)
{
p[i].type = 0;
p[i].changeVol();
}
delete []p;
p = NULL;
return 0;
}
2015-09-06