在编写重载函数时,注意不要以函数的返回值类型和参数列表中的关键字作为区分函数的标记,因此,下面的函数重载是非法的!
void move(const int nOne);
void move(int nOne);
参数列表中的const关键字不能作为区分重载函数的标记。
同理,下面的函数重载也是非法的!
int move(int nOne);
void move(int nOne);
在编写重载函数时,注意不要以函数的返回值类型和参数列表中的关键字作为区分函数的标记,因此,下面的函数重载是非法的!
void move(const int nOne);
void move(int nOne);
参数列表中的const关键字不能作为区分重载函数的标记。
同理,下面的函数重载也是非法的!
int move(int nOne);
void move(int nOne);