为什么不能初始化?
#include <iostream>#include <iomanip>
#include<string>
using namespace std;
struct student {
int num;
string name;
char sex;
int age ;
};
int main(){
student stu={111,"liu",'F',12};
cout<<stu.num<<endl;
cout<<stu.name<<endl;
cout<<stu.sex<<endl;
cout<<stu.age<<endl;
return 0;
}