The Size of an Array
Sat, 09/03/2013 - 11:55pmThe Size of an Array
As mentioned earlier in this lesson, an array consists of consecutive memory locations. Given an array, like this:
data-type Array-Name[Array-Size];
you can then calculate the total bytes of the array by the following expression:
sizeof(data-type) * Array-Size
Here data-type is the data type of the array; Array-Size specifies the total number of elements the array can take. The result returned by the expression is the total number of bytes the array takes.

