I'm still only starting out in C++ and haven't dealt with much type casting yet. I was under the impression that the syntax is (type) (variables)
however, this does not seem to work in this case.
float calcSphere (int radius)
{
float sphereSA;
sphereSA = (4 * PI * (radius*radius));
return sphereSA;
}
PI is a symbolic constant declared using #define PI 3.14
at the top of the code, I attempted to fix this problem by using (float) (4 * PI * (radius*radius))
but this did not solve anything. Google seems to return pretty obscure results on the subject too. Any solutions?