we have to use realloc only after malloc or calloc ? or we
can use initially with out depending on whether we are
using malloc or calloc in our program ?
Answer Posted / vignesh1988i
ya we must use realloc (RE-ALLOCATION) only after malloc (MEMORY ALLOCATION) ....
actually realloc is a fuction which will be mainly implemented after knowing the accurate amount of memory that is going to be used... if our memory is allocated using malloc is less compared to the total values that is going to be stored we will RE-ALLOCATE the memory to our wish to store all the values...
but in other case if the data has been stored in the allocated block by malloc , but still more is remaining we can again RE-ALLOCATE usin realloc funcion.......
thank u
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none
Which is better oop or procedural?
Explain the difference between getch() and getche() in c?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.
What is #include called?
In C, What is the #line used for?
what is the structure pointer?
what is stack , heap ,code segment,and data segment
What language is c written?
Can a pointer be static?
What is the difference between printf and scanf in c?
Write program to remove duplicate in an array?
WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..
What is the importance of c in your views?
5 Write an Algorithm to find the maximum and minimum items in a set of ānā element.