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 |
write a program to display all prime numbers
What is putchar() function?
writw a program to insert an element in the begning of a doubly linked list
post new interiew question and aptitude test papers
What is meaning of "Void main" in C Language.
24 Answers Ford, GU, HCL, IBIBS, JUW, TCS,
what r callback function?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
What is the difference between %d and %i?
What is the meaning of int *x[]();?
what is pointer?
Why is it that not all header files are declared in every C program?
10. Study the code: void show() main() { show(); } void show (char *s) { printf("%sn",s); } What will happen if it is compiled & run on an ANSI C Compiler? A)It will compile & nothing will be printed when it is executed B)it will compile but not link C)the compiler will generate an error D)the compiler will generate a warning