← Quiz: Function Pointers in C: all 15 questions
Quiz: Function Pointers in C · Question 9 of 15
Which line correctly stores the address of void greet(void) in a pointer?
Which line correctly stores the address of void greet(void) in a pointer?
- A.void *p() = greet;
- B.void (*p)(void) = greet();
- C.void (*p)(void) = greet;
- D.void p(void) = &greet;
Answer & explanation
Correct answer: void (*p)(void) = greet;
greet (or &greet) gives the address; greet() would call the function instead.
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 →