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
find the sum of two matrices and WAP for it.
Why use int main instead of void main?
Explain how do you override a defined macro?
write a program to rearrange the array such way that all even elements should come first and next come odd
What is the most efficient way to store flag values?
What is the use of bit field?
Is c is a procedural language?
When do we get logical errors?
How does free() know explain how much memory to release?
Explain the use of 'auto' keyword
How can I find out how much free space is available on disk?
Can a pointer be static?
plz let me know how to become a telecom protocol tester. thank you.
What is a struct c#?
What is the purpose of type declarations?