Hi, I am a beginner on C trying to study by myself but hit a big wall on array.
I don't get the part when I input 10 it only gives me only total of 40.
How do I only get 40 when I asked the total of 10 players' amount of gold?
I also tried to put 100 for players to receive gold, but the program shut down after inputting 1 player's gold. I guess that happened because it exceeded the amount of array that has been put there.
The weird thing I also found is that when I put 50 players it gave me the total gold amount of 50 players and 70 as well.
1. I need to know why it only produced 40 instead of 10 players' gold amount.
2. why it produced exact amount of 50 players' total gold amount when the limit of array is 10.
Thanks for the help in advance!