c++ stack overflow in windows 8 minGW -
c++ stack overflow in windows 8 minGW -
i wrote next c++ code. compiled in windows 8 mingw(from msys), if run windows stop , give stack overflow error(c00000fd). what's problem?
#include <iostream> using namespace std; class test{ public: int txt[1000]; }; int main(){ test a[1000]; homecoming 0; }
update:
ok, should if want store image size of 1920*1080? it'll 1920*1080*4 bytes.
each test object contains 1000 integers, clocking in @ 4kb each.
in main creating array of 1000 objects total of 4mb. stack can't hold 4 megs.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms686774%28v=vs.85%29.aspx says mutual default 1mb.
note that
std::vector<test> a(1000);
will work fine. std::vector
not store contents on stack local array does.
c++ mingw stack-overflow
Comments
Post a Comment