I need to create a very large array of about 10000x10000 ints. Of course I get a stack overflow. I get a stack overflow starting as low as 1000x1000. I am wondering if it is possible to overcome this problem. Thank you for any help you can offer.
The stack size is limited to a relatively small amount in comparison to the heap. Most compilers will allow you to set the stack size but still within limits. The heap size is based on your OS. For example in Windows NT/2000 etc I think it is like 4 gig.
In general you don't want to put any sizeable data structures on the stack. Use the heap for it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.