how can a call to an overloaded function be ambiguous
Answers
Answered by
3
Answer:
Answer. A call to an overloaded function can be ambiguous in one of the following two ways: *The arguments mentioned in the function where it is called do not match the arguments at the point where the function is called. *The same function is defined more than one time in the same program.......
Answered by
8
Answer:
If two or more functions have the same name and function signature, the call to an overloaded function can be unclear.
Explanation:
- Function overloading ambiguity occurs when the compiler is unable to decide which of the overloaded functions should be invoked first.
- If the compiler detects an ambiguity error, the programme is not executed.
- For objects of class type, the function call operator () can be overloaded.
- You are not inventing a new way to call a function when you overload ().
- Instead, you're defining an operator function that can take any number of parameters.
#SPJ2
Similar questions