Original Post
Recently I have been trying to compile a file with this in it:
The compiler tells me that map has an incomplete type then refuses to compile because map is uninitialized... I''m completely stumped as to why it''s doing this. I''m sure I''m initializing the array properly. Anyone have any ideas?
const unsigned short STARTROOM = 1; //The first room for a new player
const unsigned short TOTROOMS = 10; //The total number of rooms
const unsigned short TOTCAPS = 10; //The total number of rooms
//Info strings
const char* mapInfo[TOTCAPS] = {{"You stand in the center of town near a well.\n\n"},
{"This down town is surprisingly clean.\n\n"},
{"So many shops, so little time...\n\n"},
{"This blacksmith is hot, probably because of the huge fire.\n\n"},
{"The item shop. You an .buy plenty of stuff here.\n\n"},
{"A ton of flashing lights and slot machines make up this casino.\n Beware, gambling is a tax on people who are bad at math...\n\n"},
{"Ahh... Mo''s Tavern. Time for a few rounds?\n\n"},
{"All the houses in this neighborhood look exactly the same...\n\n"},
{"The open road...\n\n"},
{"This forest is thick, but there is still see plenty of light coming through the branches.\n\n"}};
//The map
struct room;
const room map[TOTROOMS] = {{0, 0, 0, 0, 0},
{2, 8, 0, 7, 0},
{0, 1, 3, 6, 1},
{5, 0, 4, 3, 2},
{0, 0, 0, 3, 3},
{0, 3, 0, 0, 4},
{0, 0, 2, 0, 5},
{0, 9, 1, 0, 6},
{1, 10, 0, 9, 7},
{7, 10, 8, 0, 8},
{8, 0, 0, 0, 9}};
//The room struct
struct room
{
unsigned short nID; //Where to go north
unsigned short sID; //Where to go south
unsigned short wID; //Where to go west
unsigned short eID; //Where to go east
unsigned short info; //The description of the room
};