Code:
int map1[12][16]={
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3},
{3,3,3,4,3,3,3,3,3,3,3,3,3,3,2,3},
{4,4,4,4,4,4,4,4,4,4,4,4,4,1,2,3},
{3,3,3,3,3,3,3,3,3,3,3,3,4,1,2,3},
{3,3,3,3,3,3,3,3,3,3,3,3,4,1,2,3},
{1,3,3,3,3,3,3,3,3,3,3,3,4,1,2,3},
{4,4,4,4,4,4,4,4,4,4,4,4,4,1,2,3},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,3},
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3},
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3},
{4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4}};
struct Map
{
public:
int Xpos; // X position in Pixels
int Ypos; // Y position in Pixels
int ID; // The ID number that corresponds to the Bitmap to display
};
Map* LoadMap(int lvl[12][16])
{
Map tm[12][16];
for (int y=0; y<12; y++)
{
for (int x=0; x<16; x++)
{
tm[y][x].Xpos = x*50;
if(lvl[y][x] == 1)
{
cout<<"1 ";
tm[y][x].ID = 1;
}
if(lvl[y][x] == 2;
{
cout<<"2 ";
tm[y][x].ID = 2;
}
If(lvl[y][x] == 3)
{
cout<<"3 ";
tm[y][x].ID = 3;
}
if(lvl[y][x] == 4)
{
cout<<"4 ";
tm[y][x].ID = 4;
}
}
tm[y][x].Ypos= y*50;
cout<<"\n";
}
return *tm; // error is here or
}
void main()
{
Map lvl1[12][16];
&lvl1=LoadMap(map1); // error is here
return;
}