What is the difference between realloc() and free()
Answer / 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 |
to convert a string without using decrement operater and string functions
is it possible to create your own header files?
How does selection sort work in c?
How can I do graphics in c?
What is Dynamic Initialization.
number of times a digit is present in a number
Is a house a mass structure?
What is structure packing in c?
Can you assign a different address to an array tag?
What is the purpose of clrscr () printf () and getch ()?
progrem to generate the following series 1 12 123 1234 12345
We can draw a box in cprogram by using only one printf();& without using graphic.h header file?