Problem Statement - Function overloading identification
Which function(s) out of the following can be considered as overloaded function(s) in the same program? Also, write the reason for not considering the other(s) as overloaded function(s).
Answer 1:
1, 2, 3 are overloaded and 4,5,6 are not.
4,5,6 will be ambiguous in relation to function 3.
Answer 2:
1, 2, 4,5 are overloaded and 3,6 are not.
3,6 would be ambiguous to function 5 as that also has one single int parameter.
Answer 3:
1,2,4,6 are overloaded and 3,5 are not.
3,5 would be ambiguous to as redeclaration error may come against function 6
Notes
Such question can have multiple answers for the reason that order is not determinable for such question when stray codes are provided.
Common Errors
Student often forget that overloading is never due to returned data type, it only depends on parameters passed to a function. It would be data type and cont of parameters.