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

How do you show the declaration of a virtual constructor?

524


Why c++ is better than c language?

555


How do you save a c++ program?

549


How to tokenize a string in c++?

600


What is data abstraction? How is it different from data encapsulation?

526






What is the purpose of ios::basefield in the following statement?

781


Do you know the problem with overriding functions?

566


Is c++ the hardest language?

555


Can a program run without main in c++?

578


What is :: operator in c++?

569


How do you invoke a base member function from a derived class in which you’ve overridden that function?

580


How does work in c++?

590


Write about c++ storage classes?

740


Explain polymorphism?

579


What is prototype for that c string function?

684