cannot return 'float (*) float'

I have the following error when I try to run my budget code in reference to this function. It says cannot convert 'float (*) (float)' to 'float' for argument '2' to 'float computeOther(float, float, float, float)'
budgetLiving, computeTax)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 float computeOther (float monthlyIncome, float computeTithing,
                    float budgetLiving, float computeTax)
{
   cout.setf(ios::fixed); //no scientific notation
   cout.setf(ios::showpoint); //always show the decimal
   cout.precision(2); //two digits for price

   float getOther = (monthlyIncome) - (computeTithing + budgetLiving +
                                       computeTax);
   return getOther;




 cout << "\tOther           $" << setw(11) << computeOther (monthlyIncome, computeTithing,
                                                              budgetLiving, computeTax)
        << setw(5) << "$" << setw(11) << actualOther << endl;

}

The second part is a good bit down from my program, but that's when I call the function, so that may be helpful to see as well.
Without seeing your entire program it seems that on line 15 variable computeTithing's type is being interpreted by the compiler as a pointer to a function (aka function pointer) that takes float as an argument with return type also float whereas it should just be type float
As gunnerfunner implies, it looks as though somewhere in the code that you haven't shown us, you've defined computeTithing to be a function pointer.
I figured it out, I was calling functions in that code, but forgot to put the parameters in there.
Topic archived. No new replies allowed.