views:

85

answers:

1

In C++, what kind of compilation errors might I run into while using function overloading, and when might these occur?

+1  A: 

This website has a couple listed, though I think your question will probably get closed as not a real question:

http://net.pku.edu.cn/~course/cs101/resource/CppHowToProgram/5e/html/ch06lev1sec17.html

  1. Creating overloaded functions with identical parameter lists and different return types is a compilation error.

  2. A function with default arguments omitted might be called identically to another overloaded function; this is a compilation error. For example, having in a program both a function that explicitly takes no arguments and a function of the same name that contains all default arguments results in a compilation error when an attempt is made to use that function name in a call passing no arguments. The compiler does not know which version of the function to choose.

0A0D