有报错[Error] no matching function for call to 'Student::getGender(const char [3])',源代码已粘贴,求助
#include <iostream>
#include<stdlib.h>
#include<string>
using namespace std;
class Student
{
public:
void setName(string _name)
{
m_strName=_name;
}
string getName()
{
return m_strName;
}
void setGender(string _gender)
{
m_strGender=_gender;
}
string getGender()
{
return m_strGender;
}
int 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(void)
{
Student stu;
stu.initScore();
stu.setName("aaaaaa");
stu.getGender("男");
stu.study(5);
stu.study(2);
cout<<stu.getName()<<""<<stu.getGender()<<""<<stu.getScore()<< endl;
system("pause");
return 0;
}
请帮忙看下哪里出错了,感谢!!
E:\newme\new.cpp In function 'int main()':
48 20 E:\newme\new.cpp [Error] no matching function for call to 'Student::getGender(const char [3])'
48 20 E:\newme\new.cpp [Note] candidate is:
22 9 E:\newme\new.cpp [Note] std::string Student::getGender()
22 9 E:\newme\new.cpp [Note] candidate expects 0 arguments, 1 provided