问题 单项选择题

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

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

解析: 所谓函数重载是指同一函数名可以对应多个函数实现。进行函数重载时,要求同名函数在参数个数上不同,或者参数类型上不同。

简答题
多项选择题