+ 15
Can there be 4d arrays?
That is very strange to think of!!
66 Respuestas
+ 35
string str = {{{{"yes"}}}};
+ 28
sure you can
imagine it like this (just an example for representing something with 4D array):
a city grid of buildings is the two dimensional portion of the array
now, each building have a number of floors, which is the 3rd dimension
and on each floor you have an array of strings for the tenants/appartments
+ 10
we actually had home assignment once to make a sim city like game in c or c++ (don't remember ;_;) where you made a grid like that for the city, had floors and tenants
+ 7
ya ya why not..
you can create as you want....
4 or more than 4 d array..
+ 5
ya ya why not.
we can do it
as you want.....
+ 4
Yes there can be it is awkward practically but theoretically compiler can make 4 coordinate storage system.
Thus arrays of 4d and above can be created. They are initialized just like 2d and 3d
+ 4
any numbers of dimensions is possible in array.
+ 4
HELL YEAH!!...... YOU CAN
+ 3
[x][x][x][x] // x array (first d)
[y] // y is array that going from every x array
[y] // So now its 2d
[y]
[y][z][z][z][z] // Every y contains z array (3d)
_______[g]
_______[g] // Every z contains g array (4d)
_______[g]
+ 3
yes
+ 3
👉 You can create as many multidimensional arrays as you want/need (unlimited).
+ 3
I suppose, it's important to note, that the more dimensions in array we have, the slower our code works (because of the way C++ interacts with computer memory).
So, of cause, you can. But think twice.
+ 2
You can create any multidimensional array
+ 2
of course it is possible, don't think about it like a physicists
+ 2
yes you can
+ 2
yes
+ 1
Thank you!! That made it way easier to understand!!!!
+ 1
yes 4d arrays can be create.
+ 1
yes, there can be array of any dimensions but generally we don't declare it as it is quite confusing.
+ 1
You, in theory, are not limited to any number. Though you'll need a quantum computer when the numbers get too large as theory only helps so much.