Explain the difference between realloc() and free() in c++?
Answer / 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 |
What is a node class?
Which should be more useful: the protected and public virtuals?
What is Destructor in C++?
Explain the difference between new() and malloc() in c++?
if int1 has the value 12, int has the value 18, and int3 has the value 21, what is the result: int1 < int2 && int2 < int 3
Write a program which employs Recursion
Out of fgets() and gets() which function is safe to use and why?
What is the basic difference between C and C++?
What are friend functions in C++?
What is the difference between reference type and pointers.
What is command line arguments in C++? What are its uses? Where we have to use this?
What is a loop? What are different types of loops in c++?