hi all!

im having trouble copying from 2d array to 3d array. im not sure this is correct. can anyone help me? i suspect the error is in the last line.

Code:
void TwoDimToThree()
{ 
int i,j,k; 
int row=512,col=512,slice;
//int slice_no = sav_slice_no[300];
for(slice=0;slice<slice_no;slice++)
{ 
for(j=0;j<row;j++) 
{ 
for(k=0;k<col;k++)
{ 
Dim_image3D[slice][j][k]=image3D[slice][pixel]; 
} 
} 
}
}
thank you!