
- Forum
- Programming Talk
- C and C++
- Array Internals
Array Internals
This is a discussion on Array Internals within the C and C++ forums, part of the Programming Talk category; I want to know more about array internals, can anyone tell me how an array is actually stored in memory? ...
-
Array Internals
I want to know more about array internals, can anyone tell me how an array is actually stored in memory?
Thanks in advance.
-
It is a interesting fact you have asked. When a programmer declares an array say as
int exforsys[100]
then the compiler allocates contiguous memory locations for the number of elements specified. In C and C++ the size of each item depends upon the data type of the array elements. For instance as given in example before exforsys is the array name of type int having 100 locations requested so each item would occupy 4bytes of memory and so 100 contiguous memory locations each of 4 bytes size would be allocated.
This is the process of array getting stored in memory internally.
-
This was really a fantastic explanation given. caradoc thanks for such a detailed reply. I am sure everyone reading this would surely find it very useful. Keep posting such useful information for us.
-
Sponsored Ads
«
Conversion to Char
|
hi all
»

Reply With Quote





