C++ Programming - OOPS Concepts - Discussion
Discussion Forum : OOPS Concepts - General Questions (Q.No. 20)
20.
Which of the following is correct about function overloading?
Discussion:
14 comments Page 1 of 2.
Baru said:
1 decade ago
Function overloading definition it contain same name but different datatype n return type n arguments list.
Vijju said:
1 decade ago
It may or may not different in the return type.
SALEHA said:
1 decade ago
In function overloading function has same name but accessing depends on the no. And type of arguments so, answer is option A & B.
Sangee said:
1 decade ago
Overloading is nothing but same function with different arguments.
Roopesh said:
1 decade ago
Function overloading means using the same function to perform different tasks.
So the name will be same. But the data types and number of arguments may vary.
So the name will be same. But the data types and number of arguments may vary.
Gunvant said:
1 decade ago
C++ allows you to specify more than one definition for a function name or an operator in the same scope, which is called function overloading and operator overloading respectively.
Mphatso said:
1 decade ago
Function overload can have the same number of argument but different of different types. So I think the correct answer should be A, B, C.
Viranshukumar said:
1 decade ago
Option B is not correct because :
int fun (int a, int b, int c)
Here I change the order or arguments.
int fun (int b, int c, int a)
int fun (int a, int b, int c)
Here I change the order or arguments.
int fun (int b, int c, int a)
Varun Aggarwal said:
10 years ago
How is argument different?
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'.
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'.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers