Question

What is a key difference between the malloc() and calloc() functions in C?

A malloc() allocates and initializes memory to zero automatically, while calloc() allocates memory without initializing it
B calloc() allocates memory and initializes all allocated bytes to zero, while malloc() allocates memory without initializing its contents
C malloc() can only allocate memory for arrays, while calloc() can only allocate memory for single variables
D calloc() allocates memory on the stack, while malloc() allocates memory on the heap
E Both malloc() and calloc() automatically free any previously allocated memory before allocating new memory
Practice Next

Hey! Ask a query

🎓
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
  • 200 Questions with Detailed Solutions
  • Section-wise Coverage (GA, English, Quant & Reasoning)