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 / vara

There are two differences.
1) is the number of arguments. Malloc() takes a single
argument (memory required in bytes), while calloc() needs
two arguments (number of variables to allocate memory, size
in bytes of a single variable).
2)malloc() does not initialize the memory allocated, while
calloc() initializes the allocated memory to ZERO.

Is This Answer Correct ?    15 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain two-dimensional array.

1127


how to execute a program using if else condition and the output should enter number and the number is odd only...

2365


When should a type cast not be used?

1105


Is c compiled or interpreted?

1241


What is operator precedence?

1278


Explain void pointer?

1092


State two uses of pointers in C?

1106


Explain the red-black trees?

1196


How can I recover the file name given an open stream?

1079


Is int a keyword in c?

1031


What are type modifiers in c?

1092


What does malloc () calloc () realloc () free () do?

1100


Explain how do you use a pointer to a function?

1152


Explain the use of keyword 'register' with respect to variables.

1094


What are dangling pointers in c?

1350