+ 1

Suppose we declared an array 'a[20];' and and we are using only 'a[10]' then what happen of the remaining space,is it wasted.?

24th Dec 2016, 12:26 PM
Rajendra Boke
Rajendra Boke - avatar
2 odpowiedzi
+ 3
Yes... This is the principle of static array, when dynamic ones get memory space when it's required ( but could result to memory fragmentation, wether static array store all his values in once contiguous memory range ).
24th Dec 2016, 12:32 PM
visph
visph - avatar
+ 1
thnxx
24th Dec 2016, 2:46 PM
Rajendra Boke
Rajendra Boke - avatar