C++ Programming - OOPS Concepts - Discussion

Discussion Forum : OOPS Concepts - General Questions (Q.No. 20)
20.
Which of the following is correct about function overloading?
The types of arguments are different.
The order of argument is different.
The number of argument is same.
Both A and B.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
14 comments Page 2 of 2.

Gelu Menumorut said:   9 years ago
First, the arguments don't count here, only the parameters count.

Then, the order of the parameters doesn't count if their type is the same, so 'B' doesn't apply.

In case the types are different and their order is different, that means different parameters' types so this case is covered by 'A'.

Smarty said:   9 years ago
Please explain it with an example.

Balaji said:   8 years ago
What is meant by order of arguments?

VRushabh said:   8 years ago
int foo(int a,float b){ } and int foo(float a,int b){} are different.

This shows function arguments order difference.


Post your comments here:

Your comments will be displayed after verification.