Visual Studio C/C++ Array Size Unhandled exception Stack overflow

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. enter image description here


You don't show any code but I presume you're declaring your array on the stack. Try declaring it on the heap (using malloc) instead. Make sure to free it later.

char* bigArray = malloc(LARGE_SIZE);
/* use bigArray */
free(bigArray);