Advertisement

Struct member question

Started by March 02, 2001 12:07 PM
0 comments, last by Zeblar Nagrim 23 years, 11 months ago
Why dosn´t this work: struct LEVEL_INFO { POINT PlayerStartPos; }; LEVEL_INFO LevelInfo = { g_Main.m_PlayerStartPos }; Why is this necessary? LEVEL_INFO LevelInfo = { { g_Main.m_PlayerStartPos.x, g_Main.m_PlayerStartPos.x } }; tHANX, Zeblar Nagrim, Lord of Chaos
i''m not sure (not a hard-core C kinda guy), but i think when using struct''s, you need to add the ''struct'' keyword befor the variable like so:

  struct LEVEL_INFO{   POINT pPlayerStartPos;   //  other members};struct LEVEL_INFO LevelInfo = { g_Main.m_PlayerStartPos };  



hope that helps.


#define Jesus 1
[source]#define Jesus 1[/source]

This topic is closed to new replies.

Advertisement