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

Answer Posted / glibwaresoftsolutions

 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

What is sizeof array?

819


What is the use of a static variable in c?

809


What do you know about the use of bit field?

835


What are the main characteristics of c language describe the structure of ac program?

955


How can I get the current date or time of day in a c program?

982


How many keywords are there in c?

833


difference between object file and executable file

6367


What is the difference between break and continue?

977


How do you initialize pointer variables?

830


pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

2440


Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.

2103


Is main is user defined function?

879


How do c compilers work?

817


Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.

1870


Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record

5002