+ 2
Function overloading with same parameters?
how to use funtion overloading when two functions require exactly same parameters? https://code.sololearn.com/cJ31O3suzyxE/?ref=app Please help me! Checkout code for more information!
7 Respuestas
+ 2
Well you can't over load funtions with the same parameters. How is the compiler supposed to know which one you are using?
A more usual case would be to have an area function and parimiter function and over load for different shapes.
If you really must solve this using overloading, then you could have 1 use float types. Or you could have an extra unused parameter in one function.
+ 2
Well I have no idea how your teacher would react to being told their wrong.
If the question is worded how it's in the comment, you might be better to use one of the hacky solutions I suggested.
I is important to be semantically correct or just technically correct?
+ 2
Hi... Overloaded functions may or may not have different return type but it should have different argument(s).
Refer - https://www.programiz.com/cpp-programming/function-overloading
Hope this is helpful...!
+ 2
Serena Yvonne thank you so much!
+ 1
Jared Bird According to your answer it seems that the question doesn't makes any sense!
What should I do now should? what should I tell my teacher?