🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.void *p() = greet;
  2. B.void (*p)(void) = greet();
  3. C.void (*p)(void) = greet;
  4. 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 →