class X_class{
public:
struct extra
{int extra1;
int extra2;
int extra3;
};
enum a
{
n,m};
struct x_struct{
char b;
char c;
int d;
int e;
std::map <int, extra> myExtraMap;
};
};
in my code I define :
x_struct myStruct;
why do I get compile errors compiling the above class? The er开发者_如何学运维ror either says: 1) expected ; before < on the line --- where I defined the map (above) if I eliminate std:: or 2) error: invalid use of ::; error: expected ; before < token
Probably you get erorrs because you didn't #include <map>
精彩评论