I have this assignment for school due tonight but I can't figure out the two errors causing problems for me. I've asked my class, I've asked twice on yahoo answers and I still don't understand what to change. If someone can please show me the exact changes that need to be made and explain them in the simplest terms I would be eternally grateful. Thanks in advance. Here's my code and the build output.
1. #include <iostream>
2. #include<string>
3. #include<iomanip>
4. using namespace std;
5.
6. int inputData(char[][50], int[], int&, int&);
7. int displayData(char[][50], int[], int);
8.
9. int main()
10. {
11. char playerName [100][50] = {0};
12. int score [100] = {0};
13. int numOfPlayers = 0;
14. int average = 0;
15. inputData(playerName, score, numOfPlayers, average);
16. displayData(playerName, score, numOfPlayers);
17.}
18. int inputData (char playerName[][50], int score[100], int &numOfPlayers, int &average)
19. {
20. while (numOfPlayers < 100)
21. {
22. cout <<" Enter Players Name(Q to quit) :";
23. cin >> playerName[numOfPlayers];
24. if (playerName[numOfPlayers][0] == 'Q') break;
25. cout << " Enter score:";
26. cin >> score[numOfPlayers];
27. numOfPlayers += 1;
28. average += score[numOfPlayers];
29. }
30. int belowAverage[50] = {0};
31. average = average / numOfPlayers;
32 for ( int i = 0; i < average; i++)
33. {
34. belowAverage = average[i];
35. }
36. if (score[i] < average)
37. score = belowAverage;
38. return 0;
39. }
40.
41. int displayData(char playerName[][50], int score[100], int numOfPlayers)
42. {
43. for (int index = 0; index < numOfPlayers; index++)
44. {
45. cout << "Player Name: " << playerName[index] << endl;
46. cout << "Score: " << score[index] << endl;
47. cout << endl;
48. }
49. return 0;
50.}
1>------ Build started: Project: LAB5A, Configuration: Debug Win32 ------
1>Compiling...
1>Lab5A.cpp
1>lab5a.cpp(34) : error C2109: subscript requires array or pointer type
1>lab5a.cpp(36) : error C2065: 'i' : undeclared identifier
1>LAB5A - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
PS: This is my first time posting, on here and I'm not entirely sure how to use the code tags properly, sorry if that is wrong.