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


Please Help Members By Posting Answers For Below Questions

What is the latest version on c++?

1206


Can union be self referenced?

1266


What character terminates all character array strings a) b) . c) END

1394


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

1164


daily Routine of father

1483