However, the value is always 2,293,580. This is strange to me because I'm usually only inputting between 1 and 3 for my individual score values. I'm not sure where this large number is coming from. I used the example from v333k to show what was being stored in my array. It shows as going in correctly. So, I'm thinking that something is wrong in my top_score function.
Thanks msh and tabstop for the help. I have the game index starting at 1 because my array is length 21. Starting it at one prompts to user to input the score for Game 1 instead of Game 0. I figured I'm still only taking 20 entries.
#define RANGE 21
int game = 0;
char instring ;
for (game = 1; game <= 20; game++)
printf ("Enter points scored in game number %d", game);
printf("Score %d = %d\n", game, points[game]); /*shows what's in my array*/
points [game] = atoi (instring);
number = top_score(points,game);
printf ("Highest points scored in a game is %d", number);
int top_score (int points2, int game2)
highscore = points2;
for (index = 0; index < game2; index++)
if (highscore < points2[index])
highscore = points2[index];