#include
#include
using namespace std;
struct Person
{
string name;
int count;
};
int main()
{
Person leader[3]={{"li",0},{"zhang",0},{"fun",0}};
error C2440: 'initializing' : cannot convert from 'char [3]' to 'struct Person'
這個需要c++11才能支持,你的編譯器是什麼?