这是我的代码,
#include<signal.h>
#include<stdio.h>
int main(int argc,char ** argv)
{
char *p=NULL;
signal(SIGSEGV,SIG_IGN); //Ignoring the Signal
printf("%d",*p);
printf("Stack Overflow"); //This has to be printed. Right?
return 0;
}
Run Code Online (Sandbox Code Playgroud)
在执行代码时,我遇到了分段错误.我使用SIG_IGN忽略了信号.所以我不应该得到分段错误.对?然后,printf()打印'*p'值后的语句也必须执行.对?