C++

Polymorphism in C++

Submitted by moazkhan on

Polymorphism in C++

In this part you will learn: 1. Polymorphism 2. C syntax 3. Showing output In this tutorial I will teach you about the concept of Polymorphism in C++. What is a Polymorphism? Polymorphism enables to write programs that process objects of classes (that are part of the same hierarchy) as if they are all objects of the hierarchy’s base class.

Function Templates in C++

Submitted by moazkhan on

Function Templates in C++

In this tutorial you will learn: 1. What are templates? 2. Why to use function templates? 3. How to use template functions in a program? 4. Basic C++ syntax What are templates? Sometime we have a function in which we need to have different data types of input on which we have to perform some operations, this function would obviously return some value.

Friend Functions in C++

Submitted by moazkhan on

Friend functions in C++

In this tutorial you will learn: 1. What are friend functions? 2. Why to use friend functions? 3. How to use friend function in a program? 4. Basic C++ syntax What are friend functions? Friend functions are those functions which can access the private as well as the protected data members of the classes. We can make a function friend of two classes so that this function can use the private and protected member of those classes to produce a specific result.

Over-riding Functions in C++

Submitted by moazkhan on

Over-riding functions in C++

In this tutorial you will learn: 1. What is over-riding of a function? 2. Why to over-riding a function? 3. How to over-ride a function in a program? 4. Basic C++ syntax What is meant by over-riding a function? By over-riding a function it means that we add some extra functionality in the function which is present in the derived class and that function has the name same as that of the base class function.

Operator Overloading in C++

Submitted by moazkhan on

Operator Overloading in C++

In this part you will learn: 1. What is Operator Overloading? 2. How Operator Overloading is useful? 3. How to use Operator Overloading in a Program? 4. C syntax What is Operator Overloading? Operator overloading is the way by which we give the already existing operators like +,-,*,/,, etc a new meaning by increasing their actual functionality.

Prototyping in C++

Submitted by Yorkiebar on
Introduction: This tutorial is on how to use Function Prototyping in C/C++. Function File: Here is a basic function file which, after running the 'int main' function, runs a custom function named 'calculate' which returns an integer and is output to the screen.
  1. #include <iostream>

Inheritance in C++

Submitted by moazkhan on

Inheritance in C++

In this tutorial you will learn: 1. What is inheritance? 2. What are different types of inheritance? 3. Why to use inheritance? 4. C++ syntax What is inheritance? A form of software reuse in which you create a class that absorbs an existing class’s data and behavior and enhances them with new capabilities.

Arrays as Class Data Member

Submitted by moazkhan on

Arrays as Class Data Member

In this tutorial you will learn: 1. How to make Arrays as Class Data Member? 2. Why to use arrays as attributes of the class? 3. How to make array of objects? 4. C++ syntax Arrays can also be the data members of the class, just like integer, float and other data type integers we can also define an array as the data members. Arrays are used as data members because if the user requires that the object contain a lot of information which is to be saved in the array then he will use array as the data member of the class.

Constant Data Members and Objects

Submitted by moazkhan on

Constant Data Members and Objects

In this tutorial you will learn: 1. What are Constant Data Members? 2. What are Constant Objects? 3. Why to use Constant Data Members and Objects? 4. How to use Constant Data Members and Objects? 5. C++ syntax What are Constant Data Members? The data members that are once initialized and can never be changed are called constant member functions. Constant member functions are just like normal data members, only ‘const’ key word is added before writing the data type of the data member of the class.