← Quiz: Dynamic Memory: all 10 questions
Quiz: Dynamic Memory · Question 1 of 10
Which function allocates memory AND sets it to zero?
Which function allocates memory AND sets it to zero?
- A.malloc
- B.calloc
- C.realloc
- D.free
Answer & explanation
Correct answer: calloc
calloc zero-initialises; malloc leaves garbage.
Can you get the rest right without peeking?
Take the timed Quiz: Dynamic Memory quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →