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

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -