#include
#include
#include
#include
void segment_fault_handler(int x)
{
*((int *)((int)(&x))+0)=x;
printf("line 17");
}
int main()
{
int r2 = 0;
signal(SIGSEGV, segment_fault_handler);
r2 = *( (int *) 0 );
printf("Ran instruction\n");
return 0;
}
this compiles and but when i try to run the .exe file i get a segmentation fault error, it does print out "Line 17" once, can someone please try to help debug this.
2007-02-28
12:44:07
·
1 answers
·
asked by
Help me Pick my Brain
2
in
Computers & Internet
➔ Programming & Design