How to call a function

How do i call this function? It doesnt show up or i get errors

1
2
3
4
5
6
7
8
9
10
  void med(int howmany, int grades[])
{
	if (howmany % 2 != 0){
		int temp = ((howmany + 1) / 2) - 1;
		cout << "The median is " << grades[temp] << endl;
	}
	else{
		cout << "The median is " << grades[(howmany / 2) - 1] << " and " << grades[howmany / 2];
	}
}
Thank you for adding the tags, but you could have just edited your original post.

In any case, as I asked in your other thread, could you show us how you are calling the function so we can see what you are doing incorrectly?
Protoype is

void med(int, int);

I do not currently have a call for it because i can not get it to work. What do i put in my main function to make this function run?
That prototype doesn't match the definition. Are you sure that's the protoype?

What is the function supposed to do? What is the meaning of the howmany and grades parameters?
Topic archived. No new replies allowed.