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...

difference between malloc and calloc

Answer Posted / bijaya

1)malloc() function does not initialize the memory which it
allocates thats why it takes the garbage value.but calloc()
function initializes the allocated memory to zero thats why
it cant take any garbage value.

2)malloc() function takes single arg.that is the variabe
which is used to indicate the memory size to be
allocated.calloc() function takes two args-i) variable which
indicates the number of memory blocks.ii)variable which
indicates the size of each blocks.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is %d called in c?

1189


How do we make a global variable accessible across files? Explain the extern keyword?

1837


How can I find the modification date and time of a file?

1044


What is a stream water?

1140


What is the correct declaration of main?

1165


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

2027


What is string function in c?

952


Explain how can I right-justify a string?

1006


When should you not use a type cast?

1077


What is the sizeof () operator?

1032


Why is it important to memset a variable, immediately after allocating memory to it ?

2008


What is malloc() function?

1100


What is a const pointer in c?

1085


a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if

1098


What is the value of uninitialized variable in c?

986