Realloc in C Language
Re – alloc ( ): When the previously allocated memory is not sapient and we need additional space for more elements. It is also possible that the memory allocated is much larger then necessary and we want to reduce it. In both the cases we can change the memory size already allocated with the help of function re – alloc.
This process is called re – allocation of memory.
Example :
ptr = malloc (size);
ptr = realloc (ptr,new size);
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment