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

Differentiate between new and malloc(), delete and free() ?

1131


#include #include struct stu { int i; char j; }; union uni { int i; char j; }; void main() { int j,k; clrscr(); struct stu s; j=sizeof(s); printf("%d",j); union uni u; k=sizeof(u); printf("%d",k); getch(); } what is value of j and k.

6183


Write a program that accept anumber in words

1706


Is there a built-in function in C that can be used for sorting data?

1177


a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

960


What are the disadvantages of a shell structure?

1261


What is nested structure with example?

1010


Did c have any year 2000 problems?

1062


what is uses of .net

1680


What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

1044


What is assert and when would I use it?

962


Why do we use int main instead of void main in c?

1098


How many types of arrays are there in c?

995


What are runtime error?

1077


Explain output of printf("Hello World"-'A'+'B'); ?

1429