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

Discussion

typedef int (*PFI)(char *, char *)creates:

  • A.type PFI, for pointer to function (of two char * arguments) returning int
  • B.Error
  • C.type PFI, function (of two char * arguments) returning int
  • D.type PFI, for pointer

Answer: A

Correct answer: type PFI, for pointer to function (of two char * arguments) returning int

The parentheses around *PFI bind the asterisk to the name before the function parameter list is applied, so the name is a pointer first and a pointer to a function second. Such aliases are the standard way of making callback tables readable: PFI compare; is a good deal clearer than writing the full declarator each time.

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

Post your comment

Please log in or register to post a comment.