← 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?
- A.It returns 0
- B.It prints NULL
- C.Undefined behaviour — usually a crash (segmentation fault)
- 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 →