simple array cause exception

前端 未结 4 1156
孤独总比滥情好
孤独总比滥情好 2020-12-12 02:46
#include \"stdafx.h\"

int _tmain(int argc, _TCHAR* argv[])
{
    float x[1000][1000];

    return 0;
}

I get \" First-chance exception at 0x013416

4条回答
  •  旧巷少年郎
    2020-12-12 03:17

    As others explained, the size of the object is bigger than the (default) size defined for function stack frame. There are two solutions: 1) create an object on the heap, which is likely to be bigger; or 2) increase the function stack frame size, which can be problematic in 32-bit environment, because you can run out of addressable space, but it can easily be done in 64-bits.

提交回复
热议问题