← Quiz: Function Pointers in C: all 15 questions
Quiz: Function Pointers in C · Question 15 of 15
What happens if you call a function pointer that is NULL?
What happens if you call a function pointer that is NULL?
- A.Nothing; the call is skipped
- B.It returns 0
- C.Undefined behaviour, usually a crash; check the pointer before calling
- D.The compiler calls a default function
Answer & explanation
Correct answer: Undefined behaviour, usually a crash; check the pointer before calling
A NULL function pointer points to no code, so jumping to it fails.
Can you get the rest right without peeking?
Take the timed Quiz: Function Pointers in C quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →