やあみんな私はcで複数の2次元配列を連結したいのですが、これは2つだけ行うとどうなりますか?
配列 1
222222222222222222222
000000000001000000000
000000000001000000000
000000000001000000000
000000000001000000000
111111111111111111111
配列 2
222222222222222222222
000000000001000000000
000000000001000000000
000000000000000000000
000000000001000000000
111111111111111111111
私が欲しいもの
222222222222222222222222222222222222222222
000000000001000000000000000000001000000000
000000000001000000000000000000001000000000
000000000001000000000000000000000000000000
000000000001000000000000000000001000000000
111111111111111111111111111111111111111111
私が得るもの
222222222222222222222000000000001000000000
000000000001000000000000000000001000000000
000000000001000000000000000000000000000000
000000000001000000000000000000001000000000
000000000001000000000000111111111111111111
111111111111111111111111111111111111111111
連結する関数
#define map_height 6
#define map_length 21
#define map_stage_length 5
char ** concatenate(){
char **array=create2DCharArray(map_height,map_length*map_stage_length);
char **mapsarray[5]={create2DCharArray(map_height,map_length),
create2DCharArray(map_height,map_length),
create2DCharArray(map_height,map_length),
create2DCharArray(map_height,map_length),
create2DCharArray(map_height,map_length)};
int i=0,j=0,n=0;
mapsarray[0]=load_map("./resources/maps/map1.map");
mapsarray[1]=load_map("./resources/maps/map2.map");
mapsarray[2]=load_map("./resources/maps/map2.map");
mapsarray[3]=load_map("./resources/maps/map2.map");
mapsarray[4]=load_map("./resources/maps/map2.map");
for (i = 0; i < map_height; i++)
{
for (n = 0; n < map_stage_length; n++)
{
for (j = 0; j < map_length; j++)
{
array[i][(n*map_length)+j]=mapsarray[n][i][j];
}
}
}
return array;
}
なぜそれが押し上げられるのか、何か考えがありますか?