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 |
Is swift based on c?
Meaning of () in c
Reverse the part of the number which is present from position i to j. Print the new number. eg: num=789876 i=2 j=5 778986
What are types of functions?
#include<stdio.h> main() {int i=1;j=1; for(;;) {if(i>5) break; else j+=1; printf("\n%d",j) i+=j; } }
When should I declare a function?
Explain can static variables be declared in a header file?
what type of errors are checked during compilation
main() {int a=200*200/100; printf("%d",a); }
write a c prog for removing duplicate character from an array and sorting remaining elements using a single array
Which is better between malloc and calloc?
WAP TO ACCEPT STRING AND COUNT A COMES N TIMES B COMES N TIMES C COMES N TIMES D COMES N TIMES AND SO ON......... AT LAST UNTIL Z COMES N TIMES...............