Category: CPP

Difference between Function Overloading and Function overriding in C++

Difference between Function Overloading and Function overriding in C++   Function overloading and Function overriding both are examples of polymorphism but they are completely different. Before we discuss the difference between them, lets discuss a little bit about them first. Function Overloading Function overloading is a feature that allows us to have same function more than once in […]

Function overloading in C++ with examples

Function overloading in C++ with examples   Function overloading is a C++ programming feature that allows us to have more than one function having same name but different parameter list, when I say parameter list, it means the data type and sequence of the parameters, for example the parameters list of a function myfuncn(int a, float b) is (int, float) which […]

Destructors in C++ with examples

Destructors in C++ with examples A destructor is a special member function that works just opposite to constructor, unlike constructors that are used for initializing an object, destructors destroy (or delete) the object. Syntax of Destructor ~class_name() { //Some code } Similar to constructor, the destructor name should exactly match with the class name. A destructor declaration […]