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

a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above

641


Explain bitwise shift operators?

621


How does normalization of huge pointer works?

617


What is the difference between local variable and global variable in c?

677


Which header file should you include if you are to develop a function which can accept variable number of arguments?

795






Explain how can a program be made to print the name of a source file where an error occurs?

676


Tell us something about keyword 'auto'.

655


What is a spanning Tree?

940


What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

718


main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }

902


What is meant by recursion?

619


What is merge sort in c?

634


What is a union?

601


why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above

646


What will be your course of action for a push operation?

655