As memory is considered to be single dimensional, then can anyone kindly tell (and explain) that “How multi-dimesional arrays are represented in Memory”.
Thanks in advance.
As memory is considered to be single dimensional, then can anyone kindly tell (and
Share
It depends on the language implementation but more often than not they are represented as a consecutive memory block row after row.
I wrote about it on my blog:
For more details on hoiw arrays are implemented in C++ take a look at:
C++ Notes: 2-D Array Memory Layout
Most of the programming languages I encoutered use a similar method to storing multidimensional arrays.