Machine-translated by Google. Questions are authored in English.
Top

Discussion

What does this declare?

void (*f)(uint8_t);

  • A.a function taking a byte and returning a pointer to void
  • B.an array of functions each taking a byte
  • C.a function pointer that itself takes no arguments
  • D.a pointer to a function taking a byte and returning nothing

Answer: D

The parentheses round the star bind it to the identifier, so f is the pointer; without them the declaration would be a function returning a void pointer. Reading such declarations from the identifier outwards is the reliable technique.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.