Home / C++


Binary Tree example code C++

Just create a file Binary.txt in “D drive”, then compile and execute the following code. Advertisements: If you have any other questions then let me know about them in comments, thanks. Advertisements:

Read More »

Read and Write File in C++ example Program

You have to create two files named students_file.txt and file.html. Below is the program code:- Contents of the file students_file.txt are: Sr.No    REG ID    NIC    Full NAME    GENDER    FATHER NAME 1    120669    6110171022039    Meeran Nabi Khan    M    Irfan Nabi Kahn 2    120649    6110179159843    Awais Khan Mughal    M    Muhammad Pervaiz Mughal …

Read More »

ArrayList in C++ with Examples

ArrayLists have been used by programmers since the late 90’s. They were implemented to be more flexible collections than arrays. They are implemented in many programming languages such as Java, C# and C++. ArrayLists are a type of collection that can be used to store various types of data. This …

Read More »

File Handling in C++ with Examples

Files are used to save or retrieve data from storage devices, e.g. we can store certain information in a text file and later on, can use that information. Input/output in C++:- C++ provides <iostream> header file, containing cin and cout which are used to take input and to write output …

Read More »

Polymorphism in C++ with Examples

Polymorphism is the capability to use an operator or method in different ways. Polymorphism gives the different function to the operators or methods. Polymorphism assigns to codes, operations that perform differently in different contexts. Polymorphism is a useful feature of the object oriented programming language in C++. Polymorphism is a …

Read More »

Function overloading in C++ with Examples

Function Overloading example

In programming languages, Function overloading is a process of declaring multiple member functions having same name but differ in one of the following Different types of parameters. Different number of parameters. Different sequence of parameters. For Example:- Sum(int, int) Sum(Float, Float) Sum(int, float) Sum(int, float, int) This process have many …

Read More »

Function Overriding in C++ with examples

Function overriding example

In C++ programming language, Functions overriding is a process of declaring the functions of same name and signatures as in a parent classes and a child classes. Functions overriding is usually used in terms of inheritance, it is also used to produce polymorphic behavior. When a member function of child …

Read More »

Multilevel Inheritance in C++ with examples

MultiLevel Inhertitance example 2

In programming, the multilevel inheritance is a technique or process in which a child class is inherited from another derived class. Let’s think of it in terms of a family tree. We have a class father, Son class is inherited from father class and grandson class is inherited from Son …

Read More »

Multiple Inheritance in C++ with examples

Multiple inheritance example 3

It is a process or mechanism in which a child class is inherited from two parent classes. Some programming languages allows multiple inheritance like C++ and some does not allows it like Java. When a child class is inherited from two or more than two parent classes, it inherits all …

Read More »

Inheritance in C++ with examples

Inheritance example

Inheritance in C++ is a programming technique for producing a new class which has a properties and functionality of a class from which it is inherited. The class which is to be produced is called child class or derived class, the class from which it is inherited is called parent …

Read More »