- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference Between Function Overloading and Overriding in C++
In this post, we will understand the difference between function overloading and function overriding in C++.
No keyword is used during overloading.
The prototype differs only based on the number or type of parameter.
It happens during compile time.
Constructors can be overloaded.
Destructor can’t be overloaded.
It can be used to achieve early binding.
The version of function being called is determined by the number or type of parameter being used.
The functions would be redefined with the same name, different number or type of parameters.
The prototype remains same throughout.
It occurs at runtime.
Virtual functions can’t be overridden.
Destructor can be overridden.
Overriding is also known as late binding.
The function that would be overridden is preceded by the ‘virtual’ keyword in the base class.
The address of the class’s object is assigned to the pointer whose function is called by the pointer.
When the function is defined, it is preceded by ‘virtual’ keyword in main class.
The same function is redefined in derived class using ‘out’ keyword.
- Function Overloading and Overriding in PHP
- What is the difference between method overloading and method overriding in Java?
- What is the difference between function overriding and method hiding in C#?
- What is overriding and overloading under polymorphism in java?
- Difference between Method Overriding and Method Hiding in C#
- What is the difference between overriding and shadowing in C#?
- What is the difference between overriding and hiding in C#?
- Method overloading v/s method overriding in Java
- What is the difference between method hiding and method overriding in Java?
- Difference between Function and Procedure
- What is the difference between method overloading and method hiding in Java?
- Function overloading and return type in C++
- Function overloading and const keyword in C++
- Difference between SCALAR and COLUMN function
- Difference between Method and Function in C#