adspace
Explain the difference between realloc() and free() in c++?
Answer Posted / Sant Singh
realloc() is a C library function that changes the size of an allocated memory block. If the new size is larger, the contents of the original block are preserved. If the new size is smaller, the contents will be truncated. free() is used to deallocate a previously allocated memory block, freeing up the associated memory for future use.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers