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

Read the declarator from the name outward, respecting the parentheses. PFI is inside (*PFI), so it is a pointer; the (char *, char *) that follows makes it a pointer to a function taking two char *; and the leading int gives the return type. Without the parentheses, int *PFI(char *, char *) would instead be a function returning int *.

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

Post your comment

Please log in or register to post a comment.