MCQ Answer

Difference between calloc() and malloc() is:

Difference between calloc() and malloc() is:

Topic : Pointers

A. calloc() takes a single argument while malloc() needs two arguments

B. malloc() takes a single argument while calloc() needs two arguments

C. malloc() initializes the allocated memory to ZERO

D. calloc() initializes the allocated memory to NULL




Correct Answer is :

B. malloc() takes a single argument while calloc() needs two arguments



Explanation
The malloc() takes a single argument, while calloc() takess two. Second, malloc() does not initialize the memory allocated, while calloc() initializes the allocated memory to ZERO.Both malloc and calloc are used in C language for dynamic memory allocation they obtain blocks of memory dynamically.
CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz