Figure 230. Example of Type Mismatch
#include <signal.h>
void (*sig_handler)(int);(1)
typedef void (*SIG_T)(); // function pointer typedef of type void (*) ()(2)
extern "C" void (*signal (int, void(*) (int))) (int); // function pointer prototype
// with return type void(*) (int)(1)
SIG_T oldsig = signal (SIGALL, sig_handler); // function pointer definition of type SIG_T
|
Notes:
CZP0257(30) An object or reference of type "void (*)()" cannot be initialized with an expression of type "extern "C" void (*)(int)"
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.