Error: expression must have integral or unscoped enum type

I don't even know what this error means. Error: expression must have integral or unscoped enum type. It show's up on line 18. This is connected to another cpp file and a header file but those don't have any errors.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include<cmath>

const double PI = 4 * atan(1.0);

double cylinderVolume(double height, double diameter)
{
  double cylindervol;
	
  cylindervol = height * PI * (0.5 * diameter) * (0.5 * diameter);

  return cylindervol;
}

double tankWallVolume(double height, double diameter, double thickness)
{
  double tankwallvol;
	
  tankwallvol = cylinderVolume - (height * PI * (0.5 * diameter - thickness) * (0.5 * diameter - thickness));

  return tankwallvol;
}
cylinderVolume is the name of the function, not a number which can be subtracted from.

Instead, use the value returned by the function.
tankwallvol = cylinderVolume( height, diameter ) - ( height * ...
thank you
Topic archived. No new replies allowed.