runtime error (运行时错误)

来源:互联网 发布:unity3d加速器 编辑:程序博客网 时间:2024/05/01 23:13

runtime error (运行时错误)就是程序运行到一半,程序就崩溃了。

比如说:

①除以零

②数组越界:int a[3]; a[10000000]=10;

③指针越界:int * p; p=(int *)malloc(5 * sizeof(int)); *(p+1000000)=10;

④使用已经释放的空间:int * p; p=(int *)malloc(5 * sizeof(int));free(p); *p=10;

⑤数组开得太大,超出了栈的范围,造成栈溢出:int a[100000000];

0 0
原创粉丝点击