How is it getting corrupted? Just what is the problem behavior?
Now, I should mention that the way you have the for() loops indexed is potentially problematic, because you are starting at 10 on each of them. Why would this be a problem? Because a ten-element array would have indices from 0 to 9, not 0 to 10. The result is that, from the very start, you are walking off of the end of the array. If you change the initialization so that it begins at 9, rather than 10 - or better still use a named constant - you should avoid this problem.
const int SCORE_COUNT = 10;
for(int scores = SCORE_COUNT - 1; scores >= 0; scores--)
cout << "What is your score? ";
cin >> score[scores];
cout << endl;
Of course, it would be more conventional to do it like this:
Yes. I need the scores to be in decending order. Like greatest to smallest. I want to do this, just to see if I can. You know? But Thank You for posting this. I am going to try this way and see if this way works. Thank You Schol-R-LEA
Lines 24 and 26.
You've got a for loop variable i going from 0 to 9. You've got a comparison between score[i] and score[i+1]
When i hits 9, that's a comparison between score and score.
Silly question for the day: Does score exist?