Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How can you read a directory in a C program?

1141


Is main an identifier in c?

1141


Explain what is the difference between a string and an array?

1164


Why is c so important?

1060


What is c language in simple words?

1068


Is sizeof a keyword in c?

965


What is malloc calloc and realloc in c?

1319


Can variables be declared anywhere in c?

1085


How can I get random integers in a certain range?

1061


What is ponter?

1265


What is the sizeof () a pointer?

985


What is array within structure?

1115


Are global variables static in c?

1163


What extern c means?

999


Can you explain the four storage classes in C?

1119