How do I increase the stack size in Visual Studio C++?

0


I am writing a program where it is necessary to compute the entries of a n x n matrix with n=1000.

If I write the following two lines in my code, I will get a stackoverflow error message:

const int n = 1000;

double matrix[n][n];

Error message:

Exception error at 0x010E1ED9 in Cubic spline.exe: 0xC00000FD: Stack overflow (Parameter: 0x00000000, 0x00292000)

How can I increase the stack size or do you think there is another way to solve the problem?

c++
matrix
stack
size
overflow
asked on Stack Overflow May 12, 2020 by MegAmaNeo1

1 Answer

1

Visual Studio uses 4KB for the stack but reserved 1MB by default. You can change this in "Configuration Properties"->Linker->System->"Stack Reserve Size" to 10MB for example.

answered on Stack Overflow May 13, 2020 by stackoverblown

User contributions licensed under CC BY-SA 3.0