Hey guys, I'm trying to create an array of integers with the size of 2,000,000. The program builds with no errors or warnings, however when I run it, it crashes. When I debug it I get a message saying Stack Overflow. After some time looking around in the debugger I narrowed down the source of my problem to the array. I understand this is a large array I'm trying to create, is there anyway around this or am I doing something wrong. The actual code I'm using to create the array is:
Before anyone asks, yes it has to be an array. Would it be better if I created the array dynamically instead?
Thanks!
int arr[2000000];
Before anyone asks, yes it has to be an array. Would it be better if I created the array dynamically instead?
Thanks!