Function Overloading

前端 未结 6 1106
死守一世寂寞
死守一世寂寞 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:52

    compilation error because same function signature is used twice in your program!

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

    function signature is (name of function + number of arguments + type for each argument) which is same in your case...

提交回复
热议问题