Runtime Error可能产生的原因

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];一般来说,在有的时候再出现这样的错误还会给提示
 
Runtime Error(ARRAY_BOUNDS_EXCEEDED) // array bounds exceed     数组越界
 
Runtime Error(DIVIDE_BY_ZERO) //divisor is nil                 除零
 
Runtime Error(ACCESS_VIOLATION) //illegal memory access         非法内存读取
 
Runtime Error(STACK_OVERFLOW) //stack overflow              系统栈过载 

你可能感兴趣的:(错误解决,p2p,蓝桥杯,linq)