|C Tutorial||Advantages of being in the heap|
Advanced C Arrays
Pointer Style and strcpy()
Pointer Type Effects
Arrays and Pointers
Array Names Are Const
Advantages of being in the heap
Disadvantages of being in the heap
• Size (in this case 1000) can be defined at run time. Not so for an array like "a".
• The array will exist until it is explicitly deallocated with a call to free().
• You can change the size of the array at will at run time using realloc(). The following changes the size of the array to 2000. Realloc() takes care of copying over the old elements.
b = realloc(b, sizeof(int) * 2000);
assert(b != NULL);
Want To Know more with
Contact for more learning: webmaster@freehost7com