+ 1
3D arrays
int a[2][3]= Means 2 arrays with 3 elements each but what does this means a[x][y],[z]
4 odpowiedzi
+ 13
There are no commas between array indexes btw.
int a[3][3][3];
// declares 3D array of size 3*3*3
+ 9
This is a 3D array, defined as:
=> An array of an array of arrays.
=> An array of 2D arrays.
=> A cube...
Imagine an element as a block.
An array would simply be a row or column of blocks.
A 2D array will be a whole sheet or table of blocks.
And a 3D array will be many of these sheets/tables, stored as elements in a row or column, like the tables in a page or book, or worksheets in an excel workbook...
So a 3D array is an array of 2d arrays.
By your definition, it translates to :
x number of y arrays of z elements each...
+ 3
Thankyou
+ 1
its a 3D array .. check my codes .. i have a program to declare a 3D array with malloc function =>
https://code.sololearn.com/cqGaghOzVM85/?ref=app