What is the difference between realloc() and free()
Answer Posted / nitin
The free subroutine frees a block of memory previously
allocated by the malloc subroutine. Undefined results occur if
the Pointer parameter is not a valid pointer. If the Pointer
parameter is a null value, no action will occur. The realloc
subroutine changes the size of the block of memory pointed to
by the Pointer parameter to the number of bytes specified by
the Size parameter and returns a new pointer to the block. The
pointer specified by the Pointer parameter must have been
created with the malloc, calloc, or realloc subroutines and
not been deallocated with the free or realloc subroutines.
Undefined results occur if the Pointer parameter is not a
valid pointer.
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
write a c program to find the sum of five entered numbers using an array named number
What standard functions are available to manipulate strings?
Explain is it better to bitshift a value than to multiply by 2?
Why is c so popular?
What is volatile variable in c?
What is call by value in c?
Explain what are header files and explain what are its uses in c programming?
What is main () in c language?
What is %d called in c?
What does the && operator do in a program code?
Why doesnt the call scanf work?
What is nested structure in c?
Can you subtract pointers from each other? Why would you?
what are the 10 different models of writing an addition program in C language?
In C, What is the #line used for?