Course Content
C++ Introduction
0/1
C++ Variables & Constants
0/1
C++Scope of Variable
0/1
C++ Keywords & Identifiers
0/1
C++ Data Types
0/1
C++ Basic I/O
0/1
C++ Type Conversion
0/1
C++ Operators
0/1
C++ Comments
0/1
C++ If-else
0/1
C++ Ternary Operator
0/1
C++ for Loop
0/1
C++ Ranged for Loop
0/1
C++ while/do-while Loop
0/1
C++ break Statement
0/1
C++ Continue Statement
0/1
C++ switch Statement
0/1
C++ goto Statement
0/1
C++ Functions
0/1
C++ User-defined Functions
0/1
C++ Default Arguments
0/1
C++ Storage Class
0/1
C++ Recursion
0/1
C++ Return by Reference
0/1
C++ Arrays
0/1
C++ Multi-dimentional Arrays
0/1
C++ Arrays & Function
0/1
C++ String
0/1
C++ Structure
0/1
C++ Structure & Functions
0/1
C++ Pointers to Structure
0/1
C++ Pointers
0/1
C++ Void Pointers
0/1
C++ Pointers & Arrays
0/1
C++ Pointers & Functions
0/1
C++ Dynamic Memory Allocation
0/1
C++ OOPs Concepts
0/1
C++ Objects and Class
0/1
C++ Constructors
0/1
C++ Destructors
0/1
C++ Constructor Overloading
0/1
C++ Objects & Function
0/1
C++ Enumeration
0/1
C++ Inheritance
0/1
C++ Inheritance Access Control
0/1
C++ Inheritance Types
0/1
C++ Polymorphism
0/1
C++ Function Overloading
0/1
C++ Function Overriding
0/1
C++ Operator Overloading
0/1
C++ Friend Function
0/1
C++ Virtual Function
0/1
C++ Abstract Class & Pure Virtual Function
0/1
C++ Encapsulation
0/1
C++ Abstraction
0/1
C++ Templates
0/1
C++ Exception Handling
0/1
C++ Multithreading
0/1
C++ Standard Library
0/1
C++ Programming Tutorials
About Lesson

C++ Introduction

In this tutorial, we will learn about Introduction, History, features & key-points, Applications and Compilers of C++.


C++ Introduction

  • C++ is object-oriented programming language. It is an extension to C programming.
  • C++ is a general purpose, case-sensitive programming language.
  • It is portable and can be used to develop applications that can be adapted to multiple platforms.
  • C++ is close to C# and java, it makes easier for programmers to switch to C++ or vice versa.

C++ History

  • It is created by Bjarne Stroustrup and his team at Bell Laboratories in 1979. Forty years later, it is one of the most widely used language in the world.
  • The name implies, C++ was derived from the C language; Bjarne’s goal was to add object-oriented programming into C.
  • A language well-respected for its portability and low-level as well as high-level functionality.
  • The language was updated 3 major times in 2011, 2014, and 2017 to C++11, C++14, and C++17.

C++ Features and Key-points

  • Simple – It is a simple language in the sense that programs can be broken down into small parts, has a rich liberary support and a variety of data-types.
  • Machine Independent but not Platform Dependent – C++ executable is not platform-independent (compiled programs on Linux won’t run on Windows), however it is machine independent.
  • Middle-level Language – It is a Middle-level language, as we can do both systems-programming (drivers, kernels, networkinf etc.) and build large-scale user applications(Photoshop, Game Engines, Media Players etc.).
  • Compiled Language – C++ is a compiled language, contributing to its speed.
  • Faster execution – C++ programs excel in execution speed. Since, it is a compiled language, and also higely procedural.

Applications of C++

C++ finds varied usage in applications such as:

  • Operating Systems & Systems Programming.(e.g. Linux-based OS Ubantu etc.)
  • Programming Language Development.(e.g. C#, Java, Perl etc.)
  • Browsers. (Chrome & Firefox)
  • Database Engines. (MySQL, MongoDB, Redis etc.)
  • Graphics & Game Engines. (Unreal-Engine, Blender, Photoshop etc.)
  • Cloud/Distributed Systems.

C++ Compilers

There ara many C++ compilers available which you can use to compile and run :

  • Apple C++. Xcode (Only supported by Apple OS.)
  • Bloodshed Dev-C++
  • Turbo C++
  • MINGW – “Minimalist GNU for Windows”
  • Code::Blocks
  • Notepad++

In this tutorial, we will learn about Get Started, Syntax, and Basic Program of C++.


Get Started

To Start using C++, you need two things:

  • A text-editor (like Notepad++, Code::Blocks and so on.), to write c++ code. Download Code::Blocks Text Editor
  • A compiler, like GCC, to translate the C++ code into a language that the computer will understand.

There are many text editors and compilers available for C++.


C++ Install IDE

  • An IDE (Intefrated Development Environment) is used to edit and Compile the code.
  • Popular IDE’s include – Code::Blocks, Eclipse, and Visual Studio.
  • These above mention IDE’s are Open Source and they can be used to edit and debug C++ code.
  • We recommend Code::Blocks for practice our examples, which we believe is a good place to start coding.

C++ Quickstart

  • Let’s create our First C++ file in Code::Blocks.
  • Open Codeblocks and go to File > New > Empty File.
  • Write the following C++ Code and save the file as myfirstprogram.cpp(File > Save File as):

// Your First C++ Program
#include <iostream>

int main() {
    std::cout << "Hello World!";
    return 0;
}

Output

Hello World!

Focus on how to run the code. and see the result of the above program.

Exercise Files
No Attachment Found
No Attachment Found
error: Content is protected !!