Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在制作一个基本游戏,并让我使用过的事情变得更容易:
struct entity { int health; int damage; SDL_Rect hitbox; } player, basicEnemy[10];
但是当我打电话时:
player.hitbox.x = 5;
或类似的东西,我得到了错误:
'player' does not name a type
我该如何解决?
typedef在关键字前面加上struct。
typedef
struct