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 |
create a C program that displays one z,two y's,three x's until twenty six A's. plzz answer i need it tomorrow.
What are the types of i/o functions?
what is const volatile?
what is the difference between postfix and prefix unary increment operators?
Write a program in C to convert date displayed in gregorian to julian date
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
What are dynamically linked and statically linked libraries?
What is structure in c explain with example?
How was c created?
What should malloc(0) do?
main() { int a[10]; printf("%d",*a+1-*a+3); }
What should malloc() do?