Report Bug

QusDifference between calloc() and malloc() is: QusDifference between calloc() and malloc() is:


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


Solution
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