Error: expression must have (pointer-to-) function type)

On line 7 of my code I declared a constant in the global scope called pi. I then later tried to use it in my function called circleArea that i defined on line 59. when entering my constant pi, an error popped up that told me Error: expression must have(pointer-to-) function type. can somebody please tell me what this means, and how to fix it? Thank you.

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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

const double pi = 3.1415926535897932384626433832795;

void circleArea(double&);
// circleArea - Calculates the area of a circle that the user enters the radius of.
// @param double& - This is the radius that the user enters.

int main() {

	cout << fixed << showpoint << setprecision(10);

	cout << "GEOMETRICAL CALCULATOR." << endl << endl;

	while(true) {

		cout << "1.Area of a Circle\n" <<
				"2.Hypotenuse of a Triangle\n" <<
				"3.Base length of a Triangle\n" <<
				"4.Quit\n" <<
				"What would you like to do? ";

		short int choice;

		cin >> choice;

		if(choice == 4)
			break;
		else if(choice < 1)
			break;
		else if(choice > 4)
			break;

		double value1,
			   value2;

		if(choice == 1) {

		}
		else if(choice == 2) {

		}
		else if(choice == 3) {

		}
		else break;
	}

	cout << "\n\n\nPROGRAM ENDED\n\n\n";

	system("pause");
	return 0;
}

void circleArea(double& value1) {
	cout << "The area of a circle with a radius of " << value1 << "is: " << (pi(pow(value1, 2)));
}
pi(pow(value1, 2)) means "call the function pi passing pow(value1, 2) as the first parameter", not "multiply the value of pi by pow(value1, 2)". * is the non-optional multiplication operator: pi * pow(value1, 2)
Thank you
Topic archived. No new replies allowed.