Category: C++
  • Sort by:
  • Latest
  • Hottest
  • Popular
  • Random
Binary Tree example code C++

Binary Tree example code C++

Just create a file Binary.txt in "D drive", then compile and execute the following code. #include<iostream> #include<fstream> #include<windows.h> using namespace std; class BST{ int info; BST *left; BST *right; public: BST() { info = -1; left = NULL; right = NULL; } void ...

READ MORE +
Read and Write File in C++ example Program

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:- #include <iostream> #include <fstream> #include <string> using namespace std; int main() { ifstream x; ofstream y; string array; x.open("students_file.txt"); if(x.fail()) { ...

READ MORE +
ArrayList in C++ with Examples

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 means two different ...

READ MORE +
File Handling in C++ with Examples

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 to console window. ...

READ MORE +
Polymorphism in C++ with Examples

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 ...

READ MORE +
Function overloading in C++ with Examples

Function overloading in C++ with Examples

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) ...

READ MORE +
Function Overriding in C++ with examples

Function Overriding in C++ with examples

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 class is ...

READ MORE +
Multilevel Inheritance in C++ with examples

Multilevel Inheritance in C++ with examples

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 class. Therefore, grandson class ...

READ MORE +
Multiple Inheritance in C++ with examples

Multiple Inheritance in C++ with examples

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 the properties and functionality ...

READ MORE +
Inheritance in C++ with examples

Inheritance in C++ with examples

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 class or a base class. Inheritance ...

READ MORE +
Insertion Sort in C++ with Examples

Insertion Sort in C++ with Examples

Insertion sort C++ is one of the most commonly used algorithm in C++ language for the sorting of fewer values or smaller arrays. It is preferred our Selection sort but other faster algorithms like bubble sort, QuickSort, and Merge Sort are preferred our insertion sort. The Insertion sorting C++ is implemented by the ...

READ MORE +
Merge Sort in C++ with examples

Merge Sort in C++ with examples

Merge sort C++ is one of the very efficient algorithm in programming languages. It is normally used for the sorting of large data. Normally, Quicksort is preferred over Merge Sort because Quicksort has a smaller constant factor. In programming Merge sort is preferred on bubble sort, selection sort and insertion sort. ...

READ MORE +
Grab our Partner's Top Rated web hosting deal - Upto 90% off