help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

help with signal() please


From: Steven Schaefer
Subject: help with signal() please
Date: Tue, 16 Jul 2002 08:33:10 -0400

I don't know if I'm still part of the mail list so please CC me at mathews20@donet.com, thanks in advance.
Every once in a while I run into a function that wants some type casting.
In my code, which I'm doing this under Linux:
...includes...
#include <signal.h>
void SIGINT_signal_handler(void)
{
 ...some code...
}
int main( int argc, char argv[] )
{
      /* TRIED A FUNCTION POINTER BUT IT DOESN'T SEEM TO DO ANY BETTER
        void (int *function_pointer)();
        function_pointer = SIGINT_signal_handler;
*/ signal(SIGINT, function_pointer);
      ... other code ...
} G++ when compiling says:
main.cpp: In function `int main(int, char *)':
main.cpp:137: passing `void (*)()' as argument 2 of `signal(int, void (*)(int))' make: *** [main.o] Error 1 How do I type cast this correctly? I've tried just about everyway I know how.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]