Intro C++
Intro C++
1. Inheritance
2. Polymorphism
3. Encapsulation
4. Abstraction
Usage of C++
o Window application
o Client-Server application
o Device drivers
C++ history
C++ Features
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
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
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;
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++.