-
Function pointer Q
I'm trying to catch a signal interrupt. The docs on signal() say if the func pointer is equal SIG_DFL then the default action is taken. SIG_DFL looks like (void (*)(int))0. Why is there a number at the end of the function pointer? How do I declare a function that looks like that?
-
That is the number zero, cast to a function pointer, and therefore represents Not An Actual Function (much like NULL represents Not An Actual Memory Address).
-
Your own interrupt function would be
Code:
void abc(int x) {
/* do stuff with parameter x */
}
Then you'd tell the system that's your function: signal( number, abc)