🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: C Pointers: all 10 questions

Quiz: C Pointers · Question 5 of 10

What happens when you dereference a NULL pointer?

What happens when you dereference a NULL pointer?

  1. A.It returns 0
  2. B.It prints NULL
  3. C.Undefined behaviour — usually a crash (segmentation fault)
  4. D.The compiler fixes it
Answer & explanation

Correct answer: Undefined behaviour — usually a crash (segmentation fault)

NULL points to no valid memory; reading it typically crashes.

Can you get the rest right without peeking?

Take the timed Quiz: C Pointers quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →