WHAT IS THE DIFFERENCE BETWEEN malloc() and calloc() in c
file management?

Answer Posted / prakashdasari

malloc () for allocating the single block of memory
calloc () for allocating multiple blocks of memory
the values assigned are garbage in case of malloc() and
proper values (zeros) are assigned in case of calloc().

Is This Answer Correct ?    114 Yes 34 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the need of structure in c?

536


Explain how can I open a file so that other programs can update it at the same time?

570


What is an array? What the different types of arrays in c?

629


What is typedef struct in c?

563


What is use of bit field?

744






What is a substring in c?

557


define string ?

639


What is malloc() function?

610


Is stack a keyword in c?

610


#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }

689


How is a null pointer different from a dangling pointer?

531


Differentiate Source Codes from Object Codes

791


What are preprocessor directives in c?

611


What is the stack in c?

700


What is %lu in c?

646