Saturday, 14 September 2013

Dynamic Array in C

Dynamic Array in C

Array by definition is a chunk of contagious memory locations. What i
understand from Dynamic is that we can allocate memory at run time. So for
Dynamic Array lets say we allocate 100 memory spaces at run time. Now we
perform some other operation and allocate few memory spaces for other
variables. Since the array we created was meant to be Dynamic so i suppose
we can add more elements t it occupying more memory spaces. But what i
fail to understand is how this is going to be contagious because the next
memory addresses are per-occupied and Arrays by definition are supposed to
be Contagious???

No comments:

Post a Comment