C++ SDL_Rect inside a struct: Does not name a type -
i making basic game , make things easier have used:
struct entity { int health; int damage; sdl_rect hitbox; } player, basicenemy[10];
but when call:
player.hitbox.x = 5;
or similiar, error:
'player' not name type
how fix this?
add typedef
in front of key word struct
.
Comments
Post a Comment