Question about reference in c++

So I'm working on an extra assignment for class right now and the other day we learned about references in c++. I'm supposed to take 3 separate functions from a previous assignment and put them together into one void function, if that makes sense. After reading over my notes, I created the following program to calculate the radius, area, and circumference of a circle however I've encountered an error that has me stumped. The errors are listed after the code, and the following is my 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
  #include <cstdlib>
#include <iostream>
#include <cmath>

using namespace std;
void calcrac (float, float, float, float, float&, float&, float&);
void getvalues (float&, float&, float&);


int main (int argc, char *argv [])
{float x1, y1, x2, y2, radius, area, circ;
getvalues (x1, y1, x2, y2, radius);

cout<<"Please enter the first x coordinate: ";
cin>>x1;
cout<<"Please enter the first y coordinate: ";
cin>>y1;
cout<<"Please enter the second x coordinate: ";
cin>>x2;
cout<<"Please enter the second y coordinate: ";
cin>>y2;


calcrac (x1, y1, x2, y2, radius, area, circ);

cout<<"Radius = "<<radius<<endl;
cout<<"Area = "<<area<<endl;
cout<<"Circumference = "<<circ<<endl;

	system ("PAUSE");
	return EXIT_SUCCESS;
}

void calcrac (float x1, float y1, float x2, float y2, float& r, 
float& a, float& c)
{ r = sqrt ((pow((x2-x1),2)) + (pow((y2-y1),2)));
a = 3.14 * (pow(r,2));
c= 2*3.14*r;
} 



It lists the following errors:
In function `int main(int, char**)':
7 too many arguments to function `void getvalues(float&, float&, float&)'
12 at this point in file
[Build Error] [main.o] Error 1



I appreciate anyone who takes the time to look at this and explain the error to me, and possible how to correct it.
on line 7 you prototype the function getvalues as taking 3 floats, but on line 11, you pass 5 values. If you look at the error, it says 7 (line number) and the error, specifying the prototype versus what happens on 12. Fix that, and you're good.
Topic archived. No new replies allowed.