class base
{
public:
int fun(int)
{}
};
class base2
{
public:
int fun(float)
{
}
};
so here qustion is both function either function
overloading or over riding;

Answers were Sorted based on User's Feedback



class base { public: int fun(int) {} }; class base2 { public: int fun(float) { } }; so ..

Answer / utpal kashyap

Overloading...
Because Function overloading depends upon type of parameters/number of parameters (NOT type of function) passed in function, So this is the example of function overloading.

Is This Answer Correct ?    11 Yes 3 No

class base { public: int fun(int) {} }; class base2 { public: int fun(float) { } }; so ..

Answer / adarsh gumashta

Overloading would be possible if class 2 extended class1
but in the case its not there . so neither overloading nor overriding .

http://stackoverflow.com/a/14181786

Is This Answer Correct ?    3 Yes 0 No

class base { public: int fun(int) {} }; class base2 { public: int fun(float) { } }; so ..

Answer / sandeep mannarakkal

Over loading and overriding , both are performing in the same scope, here both functions have different scope.
So it is NOT overloading ,
NOT over riding.

Is This Answer Correct ?    0 Yes 0 No

class base { public: int fun(int) {} }; class base2 { public: int fun(float) { } }; so ..

Answer / keerthi

overriding

Is This Answer Correct ?    0 Yes 8 No

Post New Answer

More C++ General Interview Questions

What is the best c++ ide?

0 Answers  


What it is and how it might be called (2 methods).

0 Answers  


How is computer programming useful in real life?

0 Answers  


What is #include ctype h in c++?

0 Answers  


Is there structure in c++?

0 Answers  






What is enum class in c++?

0 Answers  


What is the cout in c++?

0 Answers  


What is the purpose of extern storage specifier?

0 Answers  


Explain all the C++ concepts using examples.

0 Answers   InterGraph,


Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02

0 Answers  


given unsigned int ui1=3,ui2=7; what are the outputs of a)ui1 & ui2 b)ui1 && ui2 c)ui1 | ui2 d)ui1 || ui2 i also need the justification for the answers thank you

2 Answers  


What is the difference between static global and global ?

2 Answers   CA,


Categories