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
Are there namespaces in c?
Explain how do you view the path?
What is spaghetti programming?
What is difference between stdio h and conio h?
Explain the difference between malloc() and calloc() function?
What are the types of variables in c?
Is swift based on c?
What is putchar() function?
What is optimization in c?
How can a string be converted to a number?
What is boolean in c?
What does it mean when a pointer is used in an if statement?
What is omp_num_threads?
what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)
What is a good data structure to use for storing lines of text?