What is the difference between malloc() and calloc()?

Answer Posted / nashiinformaticssolutions

 malloc(): Allocates a single block of memory without initializing it.
 calloc(): Allocates multiple blocks of memory and initializes them to zero.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain union.

905


Explain what does it mean when a pointer is used in an if statement?

830


Can the sizeof operator be used to tell the size of an array passed to a function?

844


5 Write an Algorithm to find the maximum and minimum items in a set of ‘n’ element.

1839


What are the different types of pointers used in c language?

791


What is structure padding in c?

832


Why is python slower than c?

818


What is the difference between array_name and &array_name?

994


a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above

882


any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above

830


the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none

839


How many identifiers are there in c?

770


How can I read data from data files with particular formats?

819


What is the equivalent code of the following statement in WHILE LOOP format?

1092


What is a const pointer?

808