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


What's the difference between calloc() and malloc()?

Answers were Sorted based on User's Feedback



What's the difference between calloc() and malloc()?..

Answer / guest

calloc() takes two arguments, and initializes the allocated
memory to all-bits-0.

Is This Answer Correct ?    9 Yes 0 No

What's the difference between calloc() and malloc()?..

Answer / k.thejonath

Malloc allocates a block of memory whereas using calloc we
can allocate array of memory blocks and all locations are
initialized to zeros

Is This Answer Correct ?    5 Yes 3 No

What's the difference between calloc() and malloc()?..

Answer / valli

the diffence is
1.prototype or no of arguments
calloc takes two arguments
where as malloc takes 1 argument
void *calloc(int ,int);
first argument is no of blocks required
secund argument is no of elementts in each block required
void *malloc(int);
in this total no of bytes reuired are taken as the argument
2.
calloc clears the bytes which are allocated or reserved
where malloc can not guarentee this


sorry for my poor english

Is This Answer Correct ?    2 Yes 1 No

What's the difference between calloc() and malloc()?..

Answer / bhaswati

malloc allocates m bytes means it takes one arguments.but calloc allocate m times n bytes and initialized the memory location to zero.it takes two arguments.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

How can a program be made to print the name of a source file where an error occurs?

0 Answers  


Explain void pointer?

0 Answers  


Explain following declaration int *P(void); and int (*p)(char *a);

3 Answers  


why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???

0 Answers  


Where static variables are stored in memory in c?

0 Answers  


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

0 Answers   IBM,


What do the functions atoi(), itoa() and gcvt() do?

0 Answers   Aspire, Infogain,


What are global variables?

0 Answers  


Concat two string with most overlapped substring has to removeĀ  "abcd"+ "cdef" = "abcdef

6 Answers  


Explain what standard functions are available to manipulate strings?

0 Answers  


How can I rethow can I return a sequence of random numbers which dont repeat at all?

0 Answers  


What are the string functions? List some string functions available in c.

0 Answers  


Categories