C++ Tutorial Day-1
C++ Tutorial Day-1
by
• It is an extension to C programming.
What is C++
Inheritance
Polymorphism
Encapsulation
Abstraction
C++ Standard Libraries
The core library includes the data types, variables and literals,
etc.
The standard library includes the set of functions
manipulating strings, files, etc.
The Standard Template Library (STL) includes the set of
methods manipulating a data structure.
Usage of C++
Window application
Client-Server application
Device drivers
Embedded firmware etc
C++ Program
All C++ programs are given with C++ compiler so that you can
easily change the C++ program code.
File: main.cpp
#include <iostream>
using namespace std;
int main()
{
cout << "Hello C++ Programming";
return 0;
}
What is C?
• C is a structural or procedural oriented programming
language which is machine-independent and extensively
used in various applications.
Definition
2) Data is less secured in C. In C++, you can use modifiers for class members
to make it inaccessible for outside users.
3) C follows the top-down approach. C++ follows the bottom-up approach.
7) In C, scanf() and printf() are C++ mainly uses stream cin and cout to
mainly used for perform input and output operations.
input/output.
10) C does not provide the C++ supports the feature of namespace.
feature of namespace.
11) Exception handling is not C++ provides exception handling using Try
easy in C. It has to perform and Catch block.
using other functions.
3) Portable
C++ is a portable language and programs made in it can be run on
different machines.
4) Mid-level / Intermediate programming language
C++ includes both low-level programming and high-level
language so it is known as a mid-level and intermediate
programming language. It is used to develop system applications
such as kernel, driver, etc.
<iostream>
<cmath>
<cstdlib>
<fstream>
7) Memory Management
• C++ provides very efficient management techniques.
9) Pointer
C++ provides the feature of pointers. We can use pointers for
memory, structures, functions, array, etc. We can directly interact
with the memory by using the pointers.
10) Recursion
In C++, we can call the function within the function. It provides
code reusability for every function.
11) Extensible
C++ programs can easily be extended as it is very easy to add new
features into the existing program.
12) Object-Oriented
In C++, object-oriented concepts like data hiding, encapsulation,
and data abstraction can easily be implemented using keyword
class, private, public, and protected access specifiers. Object-
oriented makes development and maintenance easier.
13) Compiler based
• C++ is a compiler-based programming language, which means no
C++ program can be executed without compilation.
20) Clarity
The keywords and library functions used in C++ resemble
common English words.