- Dec 26, 2004
- 11,905
- 148
- 101
Doing some homework and I'm getting an error I've never seen before. I'm only in Intro to C++, so it's only been like 4 weeks.. but still
I'm defining my own variable at the top of the program as:
int totalPrice(int numberStocks, int numerator, int denominator);
and at the bottom of the program as:
int totalPrice(int numberStocks, int numerator, int denominator)
{
double fraction = static_cast<double>(numerator)/static_cast<double>(denominator);
return (numberStocks+fraction);
}
It's giving me an error that says: "illegal, left operand has type 'int (__cdecl *)(int,int,int)"
How do I fix this? I read the section for user-defined variables over and over but still can't figure out what's wrong? Tried googling it, but that didn't help at all. Any help is appreciated.
int totalPrice(int numberStocks, int numerator, int denominator);
and at the bottom of the program as:
int totalPrice(int numberStocks, int numerator, int denominator)
{
double fraction = static_cast<double>(numerator)/static_cast<double>(denominator);
return (numberStocks+fraction);
}
It's giving me an error that says: "illegal, left operand has type 'int (__cdecl *)(int,int,int)"
How do I fix this? I read the section for user-defined variables over and over but still can't figure out what's wrong? Tried googling it, but that didn't help at all. Any help is appreciated.
