阅读背景:

为什么stack overflow/underflow不会触发运行时错误?

来源:互联网 

I use this code snippet:

我使用这个代码片段:

// stackoverflow.c 
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(int argc, char** argv)
{
    int i;
    int a[10];
    // init
    a[-1] = -1;
    a[11] = 11;
    printf(" a[-1]= = %d, a[11] = %d\n", a[-1], a[11]);
    printf("I am finished.\n");
    return a[-1];
}
// stac



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: