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 IS THE DIFFERENCE BETWEEN malloc() and calloc() in c
file management?

Answer Posted / smitha

Malloc:
1. Takes only 1 argument- the size of the memory block to
be allocated.
2. Allocates memory as a single contiguous block.
3. Will fail if a single contiguous memory block of
required size is not available.

Calloc:
1. Takes two arguments - the number of memory blocks needed
and the size of each memory block.
2. It may or may not allocate a single contiguous block,
thus will not fail if a single contiguous memory block
of required size is not available.
3. Initialises the memory blocks to 0.

Is This Answer Correct ?    17 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between %d and %i?

1100


can anyone please tell about the nested interrupts?

2121


What is a global variable in c?

1012


how to create duplicate link list using C???

2560


How do you initialize pointer variables?

1099


Explain what are bus errors, memory faults, and core dumps?

1277


Why are algorithms important in c program?

1124


Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.

1408


What is union and structure in c?

1230


printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions

1160


Is c compiled or interpreted?

1194


write a program in c language to print your bio-data on the screen by using functions.

6789


which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;

3265


How many keywords are there in c?

1078


what is the function of pragma directive in c?

1123