C++ Tutorial Index

C++ Tutorial C++ History C++ Installation C++ First Program C++ cin and cout C++ Data type C++ Variable C++ operator C++ Keywords

C++ Control Statements

C++ If C++ Nested if C++ If-else C++ If-else-if C++ Switch C++ Break C++ Continue C++ Goto C++ For loop C++ While loop C++ Do while loop

C++ Functions

C++ Call by Value C++ Call by Reference C++ Recursion Function C++ Inline function C++ Friend function

C++ Arrays

Single dimension array Two dimension array

C++ Strings

C++ Strings

C++ Inheritance

C++ Inheritance Single level Inheritance Multilevel Inheritance Multiple Inheritance Hierarchical Inheritance Hybrid Inheritance

C++ Polymorphism

C++ Polymorphism C++ Overloading C++ Overriding C++ Virtual Function

C++ Pointers

C++ Pointers C++ this pointer

C++ Exception Handling

C++ Exception Handling

C++ Constructors

C++ Constructors Default Constructor Parameterize Constructor Copy constructor Constructor Overloading Destructor

C++ File Handling

C++ File Handling C++ Writing to file C++ Reading file C++ Close file

Miscellaneous

C Vs C++ C++ Comments C++ Data Abstraction C++ Identifier C++ Memory Management C++ Storage Classes C++ Void Pointer C++ Array To Function C++ Expressions C++ Features C++ Interfaces C++ Encapsulation std::min in C++ External merge sort in C++ Remove duplicates from sorted array in C++ Precision of floating point numbers Using these functions floor(), ceil(), trunc(), round() and setprecision() in C++ C++ References C++ Friend Functions C++ Mutable keyword Unary Operators in C++ Initialize Array of objects with parameterized constructors in C++ Differences between #define & const in C/C++ C++ Program to Implement Shell Sort C++ Program to Implement Merge Sort Storage Classes in C Vector resize() in C++ Passing by Reference Vs. Passing by the pointer in C++ Free vs delete() in C++ goto statement in C and C++ C++ program to read string using cin.getline() C++ String Concatenation Heap Sort in C++ Swap numbers in C++ Input Iterators in C++ Fibonacci Series in C++ C ++ Program: Alphabet Triangle and Number Triangle C++ Program: Matrix Multiplication C++ Program to Print Fibonacci Triangle Stack in C++ Maps in C++ Queue in C++ C++ Bitset C++ Algorithms Priority Queue in C++ C++ Multimap C++ Deque Function Pointer in C++ Sizeof() Operators in C++ C++ array of Pointers free() Vs delete in C Timsort Implementation Using C++ CPP Templates C++ Aggregation C++ Enumeration C++ Math Functions C++ Object Class C++ Queue Initialize Vector in C++ Vector in C++ C++ STL Components Function overloading in C++ C++ Maximum Index Problem C++ find missing in the second array C++ Program to find the product array puzzle C++ Program To Find Largest Subarray With 0 Sum C++ Program To Move All Zeros To The End Of The Array C++ Program to find the element that occurs once C++ Program to find the largest number formed from an array

C++ Tutorial

C++ Introduction

C++ is an object-oriented programming language. It was developed by Bjarne Stroustrup at AT&T Bell Laboratories. It is superset (extension) of C programming language.

Depending upon features supported by programming languages, they are classified into two different categories:

  1. Object-based programming languages
  2. Object-oriented programming languages

Object-based programming language

The language that supports programming using objects is called object-based programming language. Important features of object-based programming languages are:

  • Data encapsulation
  • Data hiding
  • Operator overloading
  • Automatic initialization

Object-oriented programming language

Object-oriented programming supports the features of object-based programming along with inheritance and dynamic binding.

C++ fully supports object-oriented programming. To understand Object-Oriented programming, we need to know the concept of a major pillar of it:

  1. Object
  2. Class
  3. Data abstraction
  4. Encapsulation
  5. Polymorphism
  6. Inheritance
  7. Dynamic binding
  8. Message passing

C++ is not a pure object-oriented language. Object-oriented means working with object and class, but in C++ program can be written without using class.

C++ Usages

C++ program is applied in a large number of different sector. Some of them are as follow:

  • Windows System
  • Real-time system
  • Object-oriented database
  • Artificial Intelligence
  • Device driver etc.

C++ Example

We have given online editor option with each C++ example. So, you can edit any example and see the changed output.

#include <iostream>    
using namespace std;    
int main() {    
   cout << "Hello C++ by TutorialAndExample";    
   return 0;    
}

Output:

Hello C++ by TutorialAndExample

Prerequisite

To learn C++, you must have knowledge of computer fundamentals only.

Audience

This C++ tutorial is written to help beginners and professionals.

C++ Tutorial Index

C++ Basics

C++ Control Statements

C++ Functions

C++ Arrays

C++ Strings

C++ Inheritance

C++ Polymorphism

C++ Pointers

C++ Exception Handling

C++ Constructors

C++ File Handling

Miscellaneous



ADVERTISEMENT
ADVERTISEMENT