Monday, July 27, 2009

C++ error, what does it mean?

IM getting the error on the functions:





to few arguments to function 'void addFractions (int , int, int, int,int%26amp;, int%26amp;); at this point in the file.





What can I do to fix this? It doesnt seem like Im doing anything wrong.











#include %26lt;iostream%26gt;


#include %26lt;iomanip%26gt;


#include %26lt;cmath%26gt;





using namespace std;











void menu();





void addFractions (int numOne, int denOne,


int numTwo, int denTwo,


int%26amp; numThree, int%26amp; denThree);





void subtractFractions (int numOne, int denOne,


int numTwo, int denTwo,


int%26amp; numThree, int%26amp; denThree);





void multiplyFractions (int numOne, int denOne,


int numTwo, int denTwo,


int%26amp; numThree, int%26amp; denThree);





void divideFractions (int numOne, int denOne,


int numTwo, int denTwo,


int%26amp; numThree, int%26amp; denThree);








int main()

C++ error, what does it mean?
When you are calling addFractions (Somewhere in your code), you are not providing six arguments.





Overloading has nothing to do with this because each function has a different name.
Reply:I don't see any errors either. Have you pasted the error causing lines of code as well?





I'm not an expert in C++ though.
Reply:I think that with function overloading you can have several functions with the same name, the compiler will then work out which one you really want by matching the parameters you pass. You must have called the function with less parameters than it was defined with ( 6 ).


No comments:

Post a Comment