Code:
struct MAP
{
int maparray1[20][56];
int maparray2[20][56];
int maparray3[20][56];
int maparray4[20][56];
int north;
int south;
int east;
int west;
};
MAP map1;
for(int a=0;a<=20;a++)
{
for(int b=0;b<=56;b++)
{
map1.maparray1[a][b]=a;
}
}
this is just one way I tried to initialize the array. I also tried doing map1.maparray={0,0,0,0,.....etc.}; and all of the possible ways i knew to initialize arrays. for all of them it gives me errors like:
c:\documents and settings\john\desktop\keldan\map.h(15) : error C2143: syntax error : missing ';' before 'for'
c:\documents and settings\john\desktop\keldan\map.h(15) : error C2143: syntax error : missing ')' before ';'
c:\documents and settings\john\desktop\keldan\map.h(15) : error C2143: syntax error : missing ';' before 'constant'
c:\documents and settings\john\desktop\keldan\map.h(15) : error C2143: syntax error : missing ';' before 'constant'
c:\documents and settings\john\desktop\keldan\map.h(15) : error C2059: syntax error : ')'
c:\documents and settings\john\desktop\keldan\map.h(16) : error C2143: syntax error : missing ';' before '{'
c:\documents and settings\john\desktop\keldan\map.h(16) : error C2447: missing function header (old-style formal list?)
Error executing cl.exe.
also when i try to initialize it different ways, it says things like i'm redefining MAP, and odd things like that. is there some special way for doing this? thanks.