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


Please Help Members By Posting Answers For Below Questions

What are the differences between Structures and Arrays?

595


regarding pointers concept

1561


What is the meaning of typedef struct in c?

579


What is the process of writing the null pointer?

598


What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

716






Write the control statements in C language

638


What is the need of structure in c?

552


What does c in a circle mean?

567


What are c header files?

568


A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?

1763


What is table lookup in c?

616


Explain the process of converting a Tree into a Binary Tree.

2090


Is that possible to add pointers to each other?

886


Why c is called top down?

615


write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list

2223