Possible Duplicate:
What is a stack overflow error?
It just happens when I declare large arrays with the size of 4096*1024
First-chance exception at 0x01382e97 in nsfclient.exe: 0xC00000FD: Stack overflow.
Unhandled exception at 0x01382e97 in nsfclient.exe: 0xC00000FD: Stack overflow.
What should I do to be able to declare big arrays in Visual Studio?
You should explicitly increase the stack size to be able to store bigger arrays on the stack. As far as I remember this is done using the /F
option.
Another option would be to use dynamic arrays(allocated using malloc
or new
).
EDIT(thanks to Jefrrey Theobald): you will also have to increase the stack size in the linker, which is done using the /stack
option. This option can also be set by right-click on the project->properties->linker->system and setting stack commit
and stack reserve size
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With