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

Explain the difference between 'operator new' and the 'new' operator?

1 Answers   Lucent, TCS,


Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c

0 Answers  


Write about c++ storage classes?

0 Answers  


How do you import payscale data from non SAP to SAP?is it through LSMW or any other way is there?

0 Answers  


What are the steps in the development cycle?

0 Answers  






Explain the concept of friend function in c++?

0 Answers  


What are the advantages and disadvantages of using inline and const?

2 Answers   Polaris, TCS, Zimmer Biomet,


What is command line arguments in C++? What are its uses? Where we have to use this?

0 Answers   HCL,


What is a literal in c++?

0 Answers  


Explain overriding.

0 Answers  


What is cin clear () in c++?

0 Answers  


When is the destructor called?

0 Answers  


Categories