Redefinition of formal parameters C++ -


Let me try to change my attitude. I have the following code, which I want to convert to work. However, whenever I try to use a function structure my variable starts to generate errors thanks to all those who have given me assistance so far.

  #include & lt; Iostream & gt; # Include & lt; Iomanip & gt; #include & lt; String & gt; using namespace std; Zero name (string name [9]); Zero grade (double score [10] [5]); Zero received data (double score [10] [5]); Get zero (int score [10] [5]) {} zero name (string name [9]) {} zero grade (double score [10] [5]) {} int main () {// create a string Students are given the average string names [9] = {"Johnson", "Aniston", "Cooper", "Blair", "Clark", "Kennedy", "Bronson", "Sunny", "Smith"}; Int Score [10] [5] = {{85, 83, 77, 91, 76}, {80, 90, 95, 93, 48}, {78, 81, 11, 90, 73}, {92, 83 , {77, 31, 52, 74, 83}, {93, 94, 89}, 30, 69, 87}, {23, 45, 96, 38, 59}, {60, 85, 45, 39, 67 }, 77, 97}, {79, 85, 28, 93, 82}, {85, 72, 49, 75, 63}}; // Calculate the grade per student and store the "grade" string at double sum = 0; Double average = 0; Double grade [10]; // Let's start with the first student. Then after the average calculation, go to the next. For calculate the amount (int quote = 0; row & lt; 11; line ++) {for (col col; 0; col & lt; 5; col ++) {// so that it is 5 sum + Scores [row] [col]; } Average = Yoga / 5; // Student average load in array grade [row] = average; // Reset Average so that this is sum = 0; Average = 0; } // print name (int i = 0; i  

In these tasks

  zero getData ( Int score [10] [5]) {int score [10] [5] = {{85, 83, 77, 91, 76}, // ...  

and < {String name [9] = {"Johnson", "Aniston", "Cooper", "Blair", "Clark", "Kennedy", "Bronson", "Sunny", "Smith"}; // ...

According to the names of your parameters, the local variable is declared in the outer maximum radius of the bodies of the works (for example, the name of the parameter in the first function is the number and Local variables are also defined as scores of the same name) C ++ standard understands such code incorrectly.

It is not also clear that you want to redefine these function parameters.

Additionally, you declare the name of the function as an integer array in the form of a parameter

  zero name (int name [9]);  

And below you consider it a string array in the form of your parameter.

  zero names (string name [9])  

Mainly neither name and grades is defined.

Your code has no meaning.

At least I think that instead of the name of the function you had to define an array with this name in the function main.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -