Original Post
Hi all, I want to make an array of structures, to represent my world. This is my code atm: I get many errors wen I try to compile this. some are: 14 C:\WINDOWS\Desktop\Joshua\RPG\main.cpp syntax error before
struct MAP[40][30]
{
SDL_Surface *background;
int value;
};
int main()
{
InitSDL();
MAP map;
SDL_Surface *temp = IMG_Load("map.gif");
for(int i = 0; i <= 40; i++)
{
for(int j = 0; j <= 30; j++)
{
map[j].background = temp;
map[j].value = 0;
}
}
return 0;
}
[' token 18 C:\WINDOWS\Desktop\Joshua\RPG\main.cpp syntax error before }' token 23 C:\WINDOWS\Desktop\Joshua\RPG\main.cpp aggregate `MAP map' has incomplete type and cannot be defined Any idea what I am doing wrong?