← Quiz: Function Pointers in C: all 15 questions
Quiz: Function Pointers in C · Question 13 of 15
If fp is a function pointer, are fp(5) and (fp)(5) different?
If fp is a function pointer, are fp(5) and (*fp)(5) different?
- A.Yes, fp(5) calls the pointer and (*fp)(5) calls the function
- B.No, both call the function that fp points to
- C.fp(5) is a compile error
- D.(*fp)(5) is a compile error
Answer & explanation
Correct answer: No, both call the function that fp points to
C allows both forms; the shorter fp(5) is more common.
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 →