逻辑错误,不知道该怎么改,求大侠帮帮忙
这个程序有逻辑错误,我想大概出在string上,但是我却不知道该怎么改………………请高手帮帮忙………………程序有什么不好的地方或者哪里逻辑不对你请明言,谢谢了!!!#include <iostream>
#include <stdio.h>
#include <string.h>
#include "student.h"
using namespace std;
void student::SetStuInfo(string No,string Name,int Age)
{
stuNo=No;
stuName=Name;
stuAge=Age;
}
void student::DisplayAll()
{
printf("XH : %s\n",stuNo);
printf("XM : %s\n",stuName);
cout << "NL : " << stuAge << endl;
}
int main()
{
student a;
a.SetStuInfo("5","liuce",21);
a.DisplayAll();
system("pause");
return 0;
}
---------------------------头文件-------------------------------
#include <iostream>
#include <string.h>
using namespace std;
class student
{
private:
string stuNo;
string stuName;
int stuAge;
public:
void SetStuInfo(string No,string Name,int Age);
void DisplayAll();
};