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

Answer Posted / abhishek pathak mnnit

1- malloc() takes one argument while calloc takes 2 argument.
2- default value of malloc is garvage while calloc is 0;
3- malloc allocate memory in contiguous form while calloc
allocate memory in contiguous form if not avilable the takes
diffrent place.

Is This Answer Correct ?    88 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If you know then define #pragma?

678


What does stand for?

601


Explain the difference between call by value and call by reference in c language?

651


what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?

1457


What is pre-emptive data structure and explain it with example?

3215






What are the types of data types and explain?

675


What do you understand by friend-functions? How are they used?

652


When should we use pointers in a c program?

636


Why c is faster than c++?

637


What is main return c?

523


I came across some code that puts a (void) cast before each call to printf. Why?

685


how to make a scientific calculater ?

1568


Can a variable be both constant and volatile?

564


Can you write a programmer for FACTORIAL using recursion?

618


Is it fine to write void main () or main () in c?

549