Answers

Question and Answer:

  Home  C++ Programmer

⟩ Explain void* realloc (void* ptr, size_t size)?

This function is used to change the size of memory object pointed by address ptr to the size given by size. If ptr is a null pointer, then realloc will behave like malloc(). If the ptr is an invalid pointer, then defined behaviour may occur depending the implementation. Undefined behaviour may occur if the ptr has previously been deallocated by free(), or dealloc() or ptr do not match a pointer returned by an malloc(), calloc() or realloc().

 219 views

More Questions for you: