What will happen in case of using function overloading and default argument at the same time? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

What will happen in case of using function overloading and default argument at the same time?

When I created two functions one which takes one float argument and other function which take two int arguments (one set to default). What would be the output if I call function_name(5).

2nd Aug 2016, 3:32 PM
Sarthak Agarwal
Sarthak Agarwal - avatar
1 ответ
0
The one that has the right type without need of implicit type casting, 5 is an int, so it will be the fct that takes int
3rd Aug 2016, 10:08 AM
Mike