下列重载函数中,正确的是( )。

admin2021-05-06  20

问题 下列重载函数中,正确的是(    )。

选项 A、void fun(int a,float b);void fun(int C,float d)
B、void fun(int a,float b);void fun(float a,int b)
C、float fun(int a,float b);int fun(int b,float a)
D、int fun(int a,int b);float fun(int a,int b)

答案B

解析 所谓函数重载是指同一函数名可以对应多个函数实现。进行函数重载时,要求同名函数在参数个数上不同,或者参数类型上不同。
转载请注明原文地址:https://kaotiyun.com/show/MLfp777K
0

最新回复(0)