Function Overloading

前端 未结 6 1138
死守一世寂寞
死守一世寂寞 2020-12-16 16:47

Let us suppose i have these three methods defined:

int F1(int, int);
int F1(float, float);
Float F1(int, int);

and i am calling method F1 h

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-16 17:46

    In Function overloading name of a functions are same but they are differ in either type of parameter or number of parameter.

    In Function overloading return type of a function is not considered.

    So this code will not even compile.Because you can not write exactly same function in one namespace.

提交回复
热议问题