What's the meaning of this piece of code? void (*signal(int sig, void (*func)(int)))(int);

后端 未结 5 1821
眼角桃花
眼角桃花 2020-11-27 14:45

I came across this piece of code and completely got lost interpreting its meaning.

#include 
void (*signal(int sig, void (*func)(int)))(int);         


        
5条回答
  •  眼角桃花
    2020-11-27 15:48

    Returning pointer to a function which takes an:

    • integer as first argument argument and
    • a pointer to a function (which takes an int and returns void) as an argument as a second argument.

    And takes an integer argument.

提交回复
热议问题