Code:
// this is the way i fixed it (adding an x <= 99998 to the while loop conditions would work too in most situations)
// (and I'm only showing what's in the "Main" function to save space)

while(true) //infinite loop
{
     big[x] = x;
     x = x + 1;
     
     if(x <= 99998)
     {
          cout << "ERROR: array is out of bounds" << endl; // this will pop up as soon as you run the program
          break;
     }
}
Sleep(3000);
<= are you sure? Shouldn't it be > ?