c++ - Stack overflow in VS multithreading -
when try create thread this
somefunc(void* param){ char currfile[500000]; char currkeyboard[24576]; char currimage[500000]; char curraddinfo[12000]; } _beginthread( somefunc, 0,null );
the program crash whith stackoverflow exception.but when this
somefunc(void* param){ char currfile[500000]; char currkeyboard[24576]; char currimage[500000]; } _beginthread( somefunc, 0,null );
the program don`t crash.why?
the reason second function allocates less memory on stack first. way stuff allocate.
use vectors instead, they'll allocate on heap, , since manage own memory won't have to.
Comments
Post a Comment