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

Answer Posted / kaushik

malloc takes only one argument but calloc takes two orguments
malloc takes garbage value initial but calloc takes zero initial value,
calloc()and malloc() also returns NULL if there is not sufficient memory available in the heap

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we use visual studio for c?

540


int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above

738


What does the c in ctime mean?

561


writ a program to compare using strcmp VIVA and viva with its output.

1514


What is const and volatile in c?

561






What is a function in c?

567


Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon

1730


What are operators in c?

575


Explain the concept and use of type void.

619


What are the properties of union in c?

582


What is the difference between declaring a variable by constant keyword and #define ing that variable?

2687


What does static variable mean in c?

646


Is c language still used?

533


What is advantage of pointer in c?

683


What are bitwise shift operators in c programming?

639