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

Is c++ the best programming language?

536


What is while loops?

615


What is the difference between a baller and a reference in C++?

576


How do we implement inheritance in c++?

584


the first character in the variable name must be an a) special symbol b) number c) alphabet

603






How does code-bloating occur in c++?

745


Can manipulators fall in love?

559


What is the use of setfill in c++?

581


write a function signature with various number of parameters.

563


What is the difference between while and do while loop? Explain with examples.

598


What is pointer with example?

560


What is problem with overriding functions?

605


What are the four partitions in which c++ compiler divides the ram?

698


What is istream and ostream in c++?

594


Assume studentNames and studentIDs are two parallel arrays of size N that hold student data. Write a pseudocode algorithm that sorts studentIDs array in ascending ID number order such that the two arrays remain parallel.

1717