Function overloading : conceptual doubt

1)You can have multiple definitions for the same function name in the same scope
2)The definition of the function must differ from each other by thetypes and/or the number of arguments in the argument list. ( 3)You can not overload function declarations that differ only by returntype.

I find 2 and 3 statements confusing , in second it mentions that they may have diff return values but in 3 statement it says you can not overload by same return typ. what does this mean please elaborate

hello @Maazkhan

statement 2 is talking only about paramters that a function is taking( note it is not talking about return type of function ).
if two functions have same name and number of parameters are different or they have different datatype then it is called function overloading.

statement 3 clearing it that if two function differs only by its return type then it is not function overloading.

1 Like

yeah i got it , Thank you . Can you also tell me what are inline functions , it isn’t uch clear from the pdf given

you can check this article -> https://www.edureka.co/blog/inline-function-in-cpp/