I've got a small block of code that calls for a user to enter a number, said number defines the number of columns in an array. Then it loops through the array x times prompting for the value of that column.
Compiles fine, runs fine, until the end. I get this:
Run-Time-Check failure #2 -Stack around the variable x was corrupted
Here is the code, it looks simple enough:
int x = 0; int entries[1]; int sum = 0; int average = 0; cout << "Enter the number of entries: "; cin >> x; for (int n = 0; n < x; ++n) { cout << "Enter the value for number [" << n << "]: "; cin >> entries[n]; }
I apologize for all these noobish questions, but well.. I'm a noob :D