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

Discussion

In the c library function void (*signal(int sig, void (*func)(int)))(int), which statement is true with respect to func?

  • A.func is a pointer to the function
  • B.func is pointer to sig
  • C.func is a static variable
  • D.func is a pointer that points to all type of data

Answer: A

Correct answer: func is a pointer to the function

Read the declaration outwards: void (*func)(int) makes func a pointer to a function taking an int and returning nothing - the handler to be installed. signal itself returns a pointer of the same kind, namely the previous handler, which is what makes the declaration so hard to read.

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

Post your comment

Please log in or register to post a comment.