Temporary breakpoint 1, main () at s3.c:22 22 { (gdb) n 23 int a=3; (gdb) 24 int b=4; (gdb) 25 int *pa=&a; (gdb) 26 int *pb=&b; (gdb) 27 int *global=&global; (gdb) 28 int (*quadrate)(int a)=&quadrate; (gdb) 29 int s=quadrate(a); (gdb) s Program received signal SIGSEGV, Segmentation fault. 0x00007fffffffde90 in ?? ()
我还试了提前按s结果跟n的效果一样就是进不去函数内部,有没有大佬知道的
程序已经崩了唉,都已经segmentation fault了,指针已经飞了,找不到函数,自然进不去了
int s=(*quadrate)(a)试试