#include<iostream>
#include<string>
using namespace std;
struct Student
{
string name;
int score;
};
main()
{
Student d[4]={ {"A",80},{"C",80},{"B",50},{"D",45} };
}
简化了一下老师的代码,但是发现用string类型定义名称总是报错: error C2440: 'initializing' : cannot convert from 'char [2]' to 'struct Student'
string 改成 char 就可以了,为什么