This is crazy. I never saw this. And it took me two days to find it because the compiler wont show any error, the program just crashes when you call this function.
And the worst thing is that it wont even enter the function.
Now that I tested it I saw that it wont crash if I set NumberOfFiles to around 3900.Code:#include <iostream> using namespace std; int f1() { cout << "Entered f1()" << endl; const int NumberOfFiles = 4000; // this is the line the crashes the program char Name[NumberOfFiles][260]= {0}; return 1; } int main() { f1(); return 0; }
I cant figure out what is it all about?