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

Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?

878


What is an array in c?

785


Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?

1813


What is time null in c?

764


What is an operator?

853


What is indirection? How many levels of pointers can you have?

908


What is typeof in c?

762


What is header file definition?

818


What is c definition?

962


Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?

825


What are the different data types in C?

946


Explain what are preprocessor directives?

821


Why n++ execute faster than n+1 ?

2310


to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?

1838


How can this be legal c?

840