Error when initializing a struct with a brace-enclosed initializer list
问题 struct CLICKABLE { int x; int y; BITMAP* alt; BITMAP* bitmap; CLICKABLE() { alt=0; } }; CLICKABLE input={1,2,0,0}; This code gives me the following error: Could not convert from brace-enclosed initializer list Could someone explain me why the compiler is giving me this error, and how I can fix it? I'm still learning the language. 回答1: Your class has a constructor, so it isn't an aggregate, meaning you cannot use aggregate initialization. You can add a constructor taking the right number and