cannot convert parameter 2 from 'void (void)' to 'void (__cdecl *)(int)'
简单程序:voidPrint1(){printf("ThisisaSIGINTinterupt!\n");}voidPrint2(){printf("ThisisaSIG...
简单程序:
void Print1()
{
printf("This is a SIGINT interupt!\n");
}
void Print2()
{
printf("This is a SIGSEGV interupt!\n");
}
int main()
{
signal(SIGINT,Print1);
printf("Please enter Ctr+c for interupt\n") ;
getchar();
signal(SIGSEGV,Print2);
printf("Please enter any key for a interupt\n");
getchar();
raise(SIGSEGV);
return 0;
}
调试结果:error C2664: 'signal' : cannot convert parameter 2 from 'void (void)' to 'void (__cdecl *)(int)'
None of the functions with this name in scope match the target type
急求解释。。。。。。。。。。 展开
void Print1()
{
printf("This is a SIGINT interupt!\n");
}
void Print2()
{
printf("This is a SIGSEGV interupt!\n");
}
int main()
{
signal(SIGINT,Print1);
printf("Please enter Ctr+c for interupt\n") ;
getchar();
signal(SIGSEGV,Print2);
printf("Please enter any key for a interupt\n");
getchar();
raise(SIGSEGV);
return 0;
}
调试结果:error C2664: 'signal' : cannot convert parameter 2 from 'void (void)' to 'void (__cdecl *)(int)'
None of the functions with this name in scope match the target type
急求解释。。。。。。。。。。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询