Hello, I have created a function, but I am getting two errors, Ambiguous call to overloaded function and more than one instance of overloaded function matches the argument list. When I was learning what ambiguity was, I learned that it was when the compiler could not differentiate between two functions with the same name. But in my program I only have the one function. Can there be another reason for this? I have my code below
you could also put your function into your own "custom" namespace.
I have read about custom namespaces before but not covered a lot about it. I am currently following a book hoping i will learn programming this time (have failed to stick with it many times in the past) so i think namespaces will come up again soon. So I will try your suggestion when I cover namespaces and learn more about what they actually are.
> I learned that it was when the compiler could not differentiate between two
> functions with the same name. But in my program I only have the one function.
foo.cpp:14:14: error: call of overloaded ‘round(double&)’ is ambiguous
/usr/include/bits/mathcalls.h:301:1: note: candidate: ‘double round(double)’
foo.cpp:6:6: note: candidate: ‘void round(double&)’
read the complete error message
¿don't understand the message? then post it and we'll explain it
Also to get you going in the right direction with namespaces I recommend you stop using the "using" clauses and instead use the scope resolution operator:: to scope std functions and classes, ie: std::cin.