I'm getting the compile error structure required on left side of . or .*
on chest.contents[0]
, but chest
is a structure:
class Item {
public:
int id;
int dmg;
};
class Chest {
public:
Item contents[10];
};
int main()
{
Chest chest();
Item item = chest.contents[0];
return 0;
}