error:function style & function definition>.<

hi every one,im in the biggenning in my prog and iv allready finished my algorithm so when i was writing the cod i wanted to make shure that first all my function well work perfictly then implement the coad that i had designed
so there were 4 errors i didnt now what is the reson of it

this is the code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# include <iostream>
# include <fstream>
using namespace std;

//declaring prototype and global variabels
int scores[50];
void averagescore(int[]);
void highestscore (int[]);
void lowestscore(int[]);
void readscore(int[]);


int main()
{
	//float average;
	//put the data into the array
	//so we will call function read score

	readscore(scores);
	//compute the average of the scores
	averagescore(scores);
    //comput the hiest score
	highestscore(scores);
    //comput the lowest score
	lowestscore(scores);

	return 0;
}

void highestscore (scores)
{
	cout << "im in function highest scor"<<endl;
}
void lowestscore(scores)
{
	cout << "im in function lowest scor"<<endl;
}
void readscore(scores)
{
	cout << "im in function read scor"<<endl;
}
void averagescore(scores)
{
	cout << "im in function average score"<<endl;
}

and thi is the error:

Error 1 error C2448: 'highestscore' : function-style initializer appears to be a function definition e:\lab6\lab6\array.cpp 31

and the same for the other functions,what dose this mean ?????
i don't know if functions declaration is right. I'd try something like void highestscore (*int scores);
Last edited on
iv tried it dosent work
Function definition should look like:

1
2
3
4
void highestscore (int scores[50])
{
	cout << "im in function highest scor"<<endl;
}
right thanks Danilesson it works perfictly know i can go on ^__^
Topic archived. No new replies allowed.