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 |
main() { float a=8.8; double b=8.8; if(a==b) printf("Equal"); else printf("not equal"); getch(); } what is the output? with reason
Write a Program to accept different goods with the number, price and date of purchase and display them
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
what is the Output? int a=4 b=3; printf("%d%d%d%d%d%d",a++,++a,a++,a++,++a,a++); printf("%d%d%d%d%d%d",b--,b--,--b,b--,--b,--b);
How we can set and clear bit in a byte using macro function?
Write code for atoi(x) where x is hexadecimal string.
what is the difference between call by value and call by reference?
5 Answers Genpact, Global Logic, Infosys,
how would a 4*3 array A[4][3] stored in Row Major Order?
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
What are # preprocessor operator in c?
What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?
Write a program to print a (*)pattern programming (A to Z) in capital in one programming ?