0% found this document useful (0 votes)
8 views

Intro C++

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Intro C++

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

What is C++

C++ is a general purpose, case-sensitive, free-form programming language


that supports object-oriented, procedural and generic programming.

Object-Oriented Programming (OOPs)

C++ supports the object-oriented programming, the four major pillar of


object-oriented programming (OOPs) used in C++ are:

1. Inheritance

2. Polymorphism

3. Encapsulation

4. Abstraction

Usage of C++

By the help of C++ programming language, we can develop different types


of secured and robust applications:

o Window application

o Client-Server application

o Device drivers

o Embedded firmware etc

C++ history

C++ programming language was developed in 1980 by Bjarne Stroustrup at


bell laboratories of AT&T (American Telephone & Telegraph), located in U.S.A.

Bjarne Stroustrup is known as the founder of C++ language.

It was develop for adding a feature of OOP (Object Oriented Programming) in


C without significantly changing the C component.

C++ Features

It provides a lot of features that are given bbelow.

 Simple
 Abstract Data types
 Machine Independent or Portable
 Mid-level programming language
 Structured programming language
 Rich Library
 Memory Management
 Quicker Compilation
 Pointers
 Recursion
 Extensible
 Object-Oriented
 Compiler based
 Reusability
 Clarity

Basic Syntax of a C++ Program

Syntax refers to the rules and regulations for writing statements in a


programming language

We can learn about basic C++ Syntax using the following program.

The image above shows the basic C++ program that contains header files,
main function, namespace declaration, etc. Let’s try to understand them one
by one.
1. Header File

The header files contain the definition of the functions and macros we are
using in our program. They are defined on the top of the C++ program.

2. Namespace

A namespace in C++ is used to provide a scope or a region where we define


identifiers.

3. Main Function

The main function is the most important part of any C++ program. The
program execution always starts from the main function.

4. Blocks

Blocks are the group of statements that are enclosed within { } braces. They
define the scope of the identifiers and are generally used to enclose the body
of functions and control statements.

5.Identifiers
We use identifiers for the naming of variables, functions, and other user-
defined data types.
Example
Int num1 = 24;

Int num2 = 34;

6.Keywords
In the C++ programming language, there are some reserved words that are
used for some special meaning in the C++ program. It can’t be used for
identifiers.
For example, the words int, return, and using are some keywords used in
our program. These all have some predefined meaning in the C++
language.
There are total 95 keywords in C++.

You might also like