为什么输出的时候 就出错 没输出 就能过
#include "stdafx.h"
#include<iostream>
#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("233333");
stu.setGender("female");
stu.study(3);
stu.study(5);
cout << stu.getName << " " << stu.getGender << " " << stu.getScore << endl;
system("pause");
return 0;
}
没有输出 就能执行 有就出错了