What is the difference between realloc() and free()
Answer Posted / 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 |
Post New Answer View All Answers
What language is lisp written in?
c language interview questions & answer
Multiply an Integer Number by 2 Without Using Multiplication Operator
Is c is a procedural language?
What is the difference between exit() and _exit() function in c?
What does a function declared as pascal do differently?
Explain can static variables be declared in a header file?
Why do we need arrays in c?
What is assignment operator?
What is 2 d array in c?
How can I direct output to the printer?
How do you initialize pointer variables?
What are the advantages of using new operator as compared to the function malloc ()?
Which is better oop or procedural?
Write a client and server program in C language using UDP, where client program interact with the Server as given below: i) The client begins by sending a request to send a string of 8 characters or series of 7 numbers, the server sends back a characters or numbers as per the request of the client. ii) In case of series of 7 numbers: The client sends a multiplication of numbers, to the server. iii) In case of a string of 8 characters: The client sends a reverse order of string to the server.. iv) Server will send an acknowledgment to the client after receiving the correct answer