I am learning was try to print out result from multi-dimensional array. My code is
int numbers[3][3][4] =
{
{
{5,3,8,7},
{1,2,3,4},
{8,9,10,11}
},
{
{12,13,14,15},
{16,17,18,19},
{20,21,22,23}
},
{
{121,131,141,151},
{161,171,181,119},
{210,211,212,213}
}
};
int i,j,k;
// int arraylength = sizeof(numbers)/sizeof(int);
// cout<<arraylength;
for(i=0;i<=3;i++){
for(j=0;j<=3;j++){
for(k=0;k<=4;k++){
cout<<numbers[i][j][k];
}
cout<<endl;
}
}
return 0;
}
I am trying to get output the number but getting negative number. also i was trying to get the length of the array to work with the loop with
int arraylength = sizeof(numbers)/sizeof(int);
with this i am getting the whole length of the array but how i can get the nested array length??