#include \"stdafx.h\"
int _tmain(int argc, _TCHAR* argv[])
{
float x[1000][1000];
return 0;
}
I get \" First-chance exception at 0x013416
Your array is simply too large to fit on the stack. You don't have enough stack space for 1000 * 1000 elements.
You'll need to allocate your array on the heap. You can do this using the new keyword, but an easier way is to just use std::vector.
std::vector > floats(1000);
for (unsigned i = 0; i != floats.size(); ++i) floats[i].resize(1000);
This will give you a two-dimensional vector of floats, with 1000 elements per vector.
Also see: Segmentation fault on large array sizes