simple array cause exception

前端 未结 4 1145
孤独总比滥情好
孤独总比滥情好 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:21

    Just declare your array static:

    static float x[1000][1000];
    

    Edited to add:

    Sigh Another silent downvoter. Not that I'm surprised. This is obviously the simplest solution to OP's problem, so it violates the prime tenet of the OOP Komissariat: The simplest solution is always wrong.

提交回复
热议问题