LINUX执行C程序时提示段错误 什么意思?一般段错误是什么引起的?

来源:百度知道 编辑:UC知道 时间:2024/05/24 07:17:48

一般是因为bufer overflow引起的,比如数组读取范围以外的内存

我印象,漏&号就会出这种错。
例如:
int x;
应当写:
scanf("%d",&x);

若写漏&号:
scanf("%d",x);
就会出这种错。

很久没用linux了。

那个有两种可能:
1、你的&符号忘了。
2、你的指针没有指向可以利用的空间。
。。。。。。
一时想不起来太多,你把程序贴出来。

▲Linux/Unix环境编程电子资料汇总:

Understanding The Linux Kernel 第一版
http://bbs.topsage.com/dispbbs.asp?boardID=119&ID=157562
Understanding The Linux Kernel 第二版
http://bbs.topsage.com/dispbbs.asp?boardID=119&ID=157563
Understanding The Linux Kernel 第三版
http://bbs.topsage.com/dispbbs.asp?boardID=119&ID=157565
Linux内核精要