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

Write a struct time where integer m, h, s are its members?

0 Answers  


What are all predefined data types in c++?

0 Answers  


What is one dimensional array in c++?

0 Answers  


Problem 6: Area of a trapezoid can be calculated by the following formula: A=(b1 b2)×h2 where b1 and b2 are the parallel sides or the bases and h is length of height Write a C code of this program

0 Answers   Maxobiz,


How to declare a pointer to an array of integers?

0 Answers  






What is the difference between C and CPP?

0 Answers   iNautix,


What does override mean in c++?

0 Answers  


Can I have a reference as a data member of a class? If yes, then how do I initialise it?

0 Answers  


What is a virtual destructor?

2 Answers  


What is a buffer c++?

0 Answers  


Can we use struct in c++?

0 Answers  


Why c++ is not a pure oop language?

0 Answers  


Categories