Professional Documents
Culture Documents
UNIT-I
September 7, 2022
1 Why C++?
2 C++ for Competitive Programming
3 Difference between C and C++
4 Evolution of C++
5 Programming Paradigms
Monolithic Programming
Structured Programming
object oriented paradigm
6 OOPS Concepts
7 Advantages of OOP
8 Usage of OOP
Why C++?
C++ is very fast and is evolving language and has many standards
such as C++ 11,14,17. C++ 20 has many new features which solves
problems easily
STL Standard Template Library a collection of C++ templates to
help programmers to handle data structures such as lists,stacks,arrays
etc.It has classes,algorithms helpful for Competitive Programming.
Ease of learning concise in Comparison to java(Python is more
concise and is also becoming popular)
C++ is not only fast but is also efficient.And with respect to java
python it is much faster.
fast
Source: https://benchmarksgame-
team.pages.debian.net/benchmarksgame/fastest/cpp.html
C C++
C is a Procedure/function- C++ is driven by a proce-
oriented Language dure/object
Data is not protected in c Data is protected in C++
C uses a top down approach C++ uses a bottom-up ap-
proach
In C we cannot give same One can initialize a number
name to two functions in a of functions with same name
program but with different arguments
C uses printf() and scanf() C++ uses cout and cin ob-
functions to read and write jects for input and output
the data operations
C uses stdio.h for input and C++ uses iosteram.h
output
Constructors and Destruc- Presnt in C++
tors are absent in C
Inline functions are not sup- Inline functions are sup-
ported in C ported in C++
Evolution of C++ I
Evolution of C++ II
Programming Paradigms
Monolithic Programming
Procedural/Structured Programming I
Procedural/Structured Programming II
Different sub-programs
accessing the same global data.
Here also the programmer can
observe the lack of secrecy.
In this programming languages
permit data transfer through
messages by means of function.
Used for developing
medium-sized software
applications.
It is difficult to implement
simultaneous
processes/parallelization.
1 Objects
2 Classes
3 Encapsulation
4 Data Abstraction
5 Inheritance
6 Polymorphism
7 Dynamic Binding
8 Message Passing
9 Reusability
10 Delagation
11 Genericity
Data Abstraction
Encapsulation
Inheritance
Polymorphism
Dynamic Binding
Message Passing
Reusability
Figure: Reusability
Delegation
Delegation means using the object of another class as a class member of
another class.
Figure: Delegation
Genericity
Advantages of OOP
Usage of OOP