我在CB里面编写的,出了11个错误 求大神帮忙看一下:
#include <iostream>
#include<stdlib.h>
#include<string>
using namespace std;
class stu
{
public:
void setName(string _name)
{
m_strName=_name;
}
getName()
{
return m_strName;
}
void setGender(string _gender)
{
m_strGender=_gender;
}
getGender()
{
return m_strGender;
}
getScore()
{
return m_iScore;
}
void initScore()
{
m_iScore=0;
}
void study(int _score)
{
m_iScore+=_score;
}
private:
string m_strName;
string m_strGender;
int m_iScore;
};
int main()
{
student stu;
stu.initScore();
stu.setName("Alex");
stu.setGender("男");
stu.study(5);
stu.study(3);
cout<<stu.getName()<<" "<<stu.getGender()<<" "<<stu.getScore()<<endl;
cout << "Hello world!" << endl;
return 0;
}