Difference between Overloading and Overriding?

Answer Posted / manu chaudhary

overloading- having different functions with same function_names but must have different signatures(parameters).

overriding- if a base class have a member function and its derived class also have a member function with same name and signature then when that same name function is called in the main function with the object of derived class then the function in the derived class is called that means the function with sam ename in the base class overrides, and this is known as function overriding.
If you have to call the function of the base class then you can call it within the scope of derived class function by using ::(scope resolution) operator.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain public, protected, private in c++?

567


How is new() different from malloc()?

635


Explain some examples of operator overloading?

647


What c++ is used for?

587


What is c++ iterator?

647






What is flush c++?

541


What does std mean in c++?

583


What is c++ stringstream?

611


What is singleton class in c++?

596


What is this weird colon-member (" : ") syntax in the constructor?

547


What does count ++ do in c++?

695


How do you add an element to a set in c++?

552


Is empty stack c++?

522


Which is not an ANSII C++ function a) sin() b) tmpnam() c) kbhit()

1008


Explain "const" reference arguments in function?

616