*nix 平台是否支持以下内容?
#include <cstdio>
#include <sys/types.h>
#include <signal.h>
#include <unistd.h>
class SignalProcessor
{
public:
static void OnMySignal(int sig_num)
{
printf("Caught %d signal\n", sig_num);
fflush(stdout);
return;
}
};
using namespace std;
int main()
{
signal(SIGINT,SingalProcessor::OnMySignal);
printf("Ouch\n");
pause();
return 0;
}