![]() |
#2
yuccn2013-03-19 15:35
|

#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
struct Student
{
int num;
string name;
char sex;
int age;
};
int main()
{
Student stu={97001, "LinLin", 'F', 19};//好似问题在这里,但我不知道怎么修改!!
cout<<"Num: "<<stu.num<<endl;
cout<<"Name:"<<stu.name<<endl;
cout<<"sex:"<<stu.sex<<endl;
cout<<"Age:"<<stu.age<<endl;
return 0;
}//但这在vc6.0 编译时会出错,在vs2010不会出错,怎么回事???什么错误???
#include <iomanip>
#include <string>
using namespace std;
struct Student
{
int num;
string name;
char sex;
int age;
};
int main()
{
Student stu={97001, "LinLin", 'F', 19};//好似问题在这里,但我不知道怎么修改!!
cout<<"Num: "<<stu.num<<endl;
cout<<"Name:"<<stu.name<<endl;
cout<<"sex:"<<stu.sex<<endl;
cout<<"Age:"<<stu.age<<endl;
return 0;
}//但这在vc6.0 编译时会出错,在vs2010不会出错,怎么回事???什么错误???