Skip to content
overriding vs overloading in c++

Check out my free resources and deep-dive courses.

Occasionally I’ve heard these terms used interchangeably – but they actually refer to two completely separate concepts.

So, What’s What?

Overloading describes the creation of a method with the same name as an existing method, but different parameters. For example:

int doSomething();
int doSomething(int);
int doSomething(int, double);

Overriding describes the creation of a method in a derived class  with the same name and parameters as an existing method in its base class.

class base {
public:
virtual int doSomething();
};

class derived : public base
{
public:
int doSomething() override;
};

The actual method that is called in this case depends on what kind of object you are dealing with, and whether the base class is abstract, the methods are virtual, and so on.

How Do You Remember The Difference?

Think of it as load versus ride.

Overloading gives you loads of methods in the same class with different parameters.

Overriding lets you ride on the back of a method declared in a base class.

Easy, eh?


If you’re learning C++ and want to understand how these concepts fit together, my FREE 10-Minute Guide to Object-Oriented Programming provides a quick introduction to inheritance, polymorphism, encapsulation and the other fundamental principles of OOP.

free the mallocs mug gift

A little something I made

When I’m not writing about code, I design geeky mugs. If you’d like one for your desk, or know someone who would, take a look at my designs.

1 thought on “Overriding Or Overloading In C++?”

  1. Thanks for this! I’ve been getting them confused for years now; your memory technique helps a lot.

Leave a Reply

Your email address will not be published. Required fields are marked *

Save to list