SlideShare a Scribd company logo
BASICS OF C++
Chapter 2
1By:-Gourav Kottawar
contents
2
 2.1 A Brief History of C & C++
 2.2 C Vs C++
 2.3 A Simple C++ Program
 2.4 Application of C++
 2.5 Structure & Class
 2.6 Compiling & Linking
% - 3
By:-Gourav Kottawar
2.1 A Brief History of C & C++
3
 The C++ programming language
has a history going back to 1979,
when Bjarne Stroustrup was doing
work for his Ph.D. thesis
 The Simula 67 language
 "C with Classes“
 C++
By:-Gourav Kottawar
2.2 C Vs C++
4
C C++
Language
Type
Procedural Oriented Language
Multi paradigm language, includes STL,
generic programming, procedural
programming, functional programming,
metaprogramming Object Oriented
Programming
Platforms
Almost anything on the planet; requires
recompile
Any, but libraries used can make it limited
Developed
by
Dennis Ritchie & Bell Labs Bjarne Stroustrup
Influenced
awk, csh, C++, C#, Objective-C, BitC, D,
Concurrent C, Java, JavaScript, Limbo,
Perl, PHP
Ada 95, C#, Java, PHP, D, Aikido
Typing
Discipline
Static, Weak Static, Unsafe, Nominative
Paradigms
Imperative (procedural) systems
implementation language
Multi-paradigm, STL, generic programming,
procedural programming, functional
programming, metaprogrammingBy:-Gourav Kottawar
5
C C++
Influenced
by
B (BCPL,CPL), ALGOL 68, Assembly C, Simula, Ada 83, ALGOL 68, CLU, ML
Designed
by
Dennis Ritchie Bjarne Stroustrup
Programmi
ng-String
type
Cannot use string type but declare it
as an array of characters
Can use std::string or design a string by user
Major
Implement
ations
GCC, MSVC, Borland C, Watcom C
GNU Compiler Collection, Microsoft Visual C++,
Borland C++ Builder
Speed
C applications are faster to compile
and execute than C++ applications
+-5% when compare with C if you know how to
make a good use of C++.The performance of C++
and C are equal, since compilers are mature(now
is 2012), if your C++ codes are much slower than
C, don't flame C++ but blame yourself.
By:-Gourav Kottawar
6
OOP
(Object
Oriented
Programmi
ng)
Not built in; has the freedom to
setup structures to act like objects.
Lacking the ability to
encapsulate(annouced private) is a
big weakpoint
Yes-polymorphism and inheritance, Classes.
Appeared
in
1972 1985
Execution
Flow
Top to Bottom Bottom to Top
Garbage
Collection
Manual; allows better
management of memory.
Manual, you could manage the memory as C
did, or use smart pointer , destructor to provide
better and safer mechanism.According to your
implementation, smart pointer can be zero
runtime impact
Usual
filename
extensions
.c .cc, .cpp, .hh, .hpp
By:-Gourav Kottawar
Simple C++ program
7
#include <iostream.h>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
By:-Gourav Kottawar
Simple C++ program
8
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
By:-Gourav Kottawar
Simple C++ program
9
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
By:-Gourav Kottawar
namespace
 Namespace is a new concept introduced by the
ANSI C++ standards committee.
 This defines a scope for the identifiers that are
used in a program. For using the identifier defined
in the namespace scope we must include the
using directive, like
Using namespace std;
 Here, std is the namespace where ANSI C++
standard class libraries are defined.
 All ANSI C++ programs must include this
directive. This will bring all the identifiers defined in
std to the current global scope.
 Using and namespace are the new keyword of
C++.
10
By:-Gourav Kottawar
Simple C++ program
11
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
By:-Gourav Kottawar
Simple C++ program
12
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
By:-Gourav Kottawar
13
By:-Gourav Kottawar
14
By:-Gourav Kottawar
Applications of C++
 Since C++ allow us to create hierarchy related
objects, we can build special object-oriented
libraries which can be used later by many
programmers.
 While C++ is able to map the real-world problem
properly, the C part of C++ gives the language the
ability to get closed to the machine-level details.
 C++ programs are easily maintainable and
expandable. When a new feature needs to be
implemented, it is very easy to add to the existing
structure of an object.
• It is expected that C++ will replace C as a general-
purpose language in the near future.
15
By:-Gourav Kottawar

More Related Content

PPTX
Presentation on C++ Programming Language
PDF
Introduction to cpp
PPT
Lecture01
PDF
C++ Training
PDF
C++ book
PPTX
Oops presentation
PDF
Presentation on C++ Programming Language
Introduction to cpp
Lecture01
C++ Training
C++ book
Oops presentation

What's hot (20)

PPTX
C++ language basic
PPTX
Learn c++ Programming Language
PPTX
PPTX
45 Days C++ Programming Language Training in Ambala
PPTX
C++ Presentation
PPTX
Cs1123 3 c++ overview
PPT
Structure of C++ - R.D.Sivakumar
PPTX
Introduction to C++
PDF
Modern c++ (C++ 11/14)
PPTX
Summary of C++17 features
DOCX
Diff between c and c++
PDF
C++11 concurrency
PPTX
C introduction by thooyavan
PPTX
C++11: Feel the New Language
PDF
C++17 introduction - Meetup @EtixLabs
PDF
Modern C++
PDF
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
PPTX
C Theory
PDF
C++11
PPT
Advanced Programming C++
C++ language basic
Learn c++ Programming Language
45 Days C++ Programming Language Training in Ambala
C++ Presentation
Cs1123 3 c++ overview
Structure of C++ - R.D.Sivakumar
Introduction to C++
Modern c++ (C++ 11/14)
Summary of C++17 features
Diff between c and c++
C++11 concurrency
C introduction by thooyavan
C++11: Feel the New Language
C++17 introduction - Meetup @EtixLabs
Modern C++
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
C Theory
C++11
Advanced Programming C++
Ad

Similar to basics of c++ (20)

PDF
The C++ Programming Language
PPTX
Session 1 - c++ intro
DOC
Assignment of c++ programming language 2016.doc
PPTX
C++ TRAINING IN AMBALA CANTT! BATRA COMPUTER CENTER
PPT
11 cpp
PPTX
Cpp-c++.pptx
PDF
Object oriented programming c++
PPTX
C+Comprehensive overview of the IoT system aims, architecture, challenges, ap...
PPTX
Introduction to C++
PPTX
object oriented programming language fundamentals
PPTX
Unit 1 of c++ part 1 basic introduction
PPT
c++ ppt.ppt
PPTX
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
PPTX
c++.pptx ppt representation of c plus lanjhgvghihh
PPT
Payal C++ ppt presentation.ppt college class
PDF
Prog1-L1.pdf
PPTX
2CPP02 - C++ Primer
PPTX
C++ l 1
RTF
C++
PDF
Programming c++
The C++ Programming Language
Session 1 - c++ intro
Assignment of c++ programming language 2016.doc
C++ TRAINING IN AMBALA CANTT! BATRA COMPUTER CENTER
11 cpp
Cpp-c++.pptx
Object oriented programming c++
C+Comprehensive overview of the IoT system aims, architecture, challenges, ap...
Introduction to C++
object oriented programming language fundamentals
Unit 1 of c++ part 1 basic introduction
c++ ppt.ppt
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
c++.pptx ppt representation of c plus lanjhgvghihh
Payal C++ ppt presentation.ppt college class
Prog1-L1.pdf
2CPP02 - C++ Primer
C++ l 1
C++
Programming c++
Ad

More from gourav kottawar (20)

PPTX
operator overloading & type conversion in cpp
PPTX
constructor & destructor in cpp
PPTX
classes & objects in cpp
PPTX
expression in cpp
PPT
working file handling in cpp overview
PPT
pointers, virtual functions and polymorphisms in c++ || in cpp
PPTX
exception handling in cpp
PPT
cpp input & output system basics
PPTX
operator overloading & type conversion in cpp over view || c++
PPTX
constructor & destructor in cpp
PPTX
basics of c++
PPTX
classes & objects in cpp overview
PPTX
expression in cpp
PPT
SQL || overview and detailed information about Sql
PPT
SQL querys in detail || Sql query slides
PPT
Rrelational algebra in dbms overview
PPT
overview of database concept
PPT
Relational Model in dbms & sql database
PPTX
DBMS information in detail || Dbms (lab) ppt
PPTX
security and privacy in dbms and in sql database
operator overloading & type conversion in cpp
constructor & destructor in cpp
classes & objects in cpp
expression in cpp
working file handling in cpp overview
pointers, virtual functions and polymorphisms in c++ || in cpp
exception handling in cpp
cpp input & output system basics
operator overloading & type conversion in cpp over view || c++
constructor & destructor in cpp
basics of c++
classes & objects in cpp overview
expression in cpp
SQL || overview and detailed information about Sql
SQL querys in detail || Sql query slides
Rrelational algebra in dbms overview
overview of database concept
Relational Model in dbms & sql database
DBMS information in detail || Dbms (lab) ppt
security and privacy in dbms and in sql database

Recently uploaded (20)

PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
Pharma ospi slides which help in ospi learning
PDF
Trump Administration's workforce development strategy
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
GDM (1) (1).pptx small presentation for students
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PPTX
Cell Types and Its function , kingdom of life
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
Complications of Minimal Access Surgery at WLH
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Weekly quiz Compilation Jan -July 25.pdf
Pharma ospi slides which help in ospi learning
Trump Administration's workforce development strategy
Computing-Curriculum for Schools in Ghana
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Anesthesia in Laparoscopic Surgery in India
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
FourierSeries-QuestionsWithAnswers(Part-A).pdf
GDM (1) (1).pptx small presentation for students
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Cell Types and Its function , kingdom of life
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Abdominal Access Techniques with Prof. Dr. R K Mishra
school management -TNTEU- B.Ed., Semester II Unit 1.pptx

basics of c++

  • 1. BASICS OF C++ Chapter 2 1By:-Gourav Kottawar
  • 2. contents 2  2.1 A Brief History of C & C++  2.2 C Vs C++  2.3 A Simple C++ Program  2.4 Application of C++  2.5 Structure & Class  2.6 Compiling & Linking % - 3 By:-Gourav Kottawar
  • 3. 2.1 A Brief History of C & C++ 3  The C++ programming language has a history going back to 1979, when Bjarne Stroustrup was doing work for his Ph.D. thesis  The Simula 67 language  "C with Classes“  C++ By:-Gourav Kottawar
  • 4. 2.2 C Vs C++ 4 C C++ Language Type Procedural Oriented Language Multi paradigm language, includes STL, generic programming, procedural programming, functional programming, metaprogramming Object Oriented Programming Platforms Almost anything on the planet; requires recompile Any, but libraries used can make it limited Developed by Dennis Ritchie & Bell Labs Bjarne Stroustrup Influenced awk, csh, C++, C#, Objective-C, BitC, D, Concurrent C, Java, JavaScript, Limbo, Perl, PHP Ada 95, C#, Java, PHP, D, Aikido Typing Discipline Static, Weak Static, Unsafe, Nominative Paradigms Imperative (procedural) systems implementation language Multi-paradigm, STL, generic programming, procedural programming, functional programming, metaprogrammingBy:-Gourav Kottawar
  • 5. 5 C C++ Influenced by B (BCPL,CPL), ALGOL 68, Assembly C, Simula, Ada 83, ALGOL 68, CLU, ML Designed by Dennis Ritchie Bjarne Stroustrup Programmi ng-String type Cannot use string type but declare it as an array of characters Can use std::string or design a string by user Major Implement ations GCC, MSVC, Borland C, Watcom C GNU Compiler Collection, Microsoft Visual C++, Borland C++ Builder Speed C applications are faster to compile and execute than C++ applications +-5% when compare with C if you know how to make a good use of C++.The performance of C++ and C are equal, since compilers are mature(now is 2012), if your C++ codes are much slower than C, don't flame C++ but blame yourself. By:-Gourav Kottawar
  • 6. 6 OOP (Object Oriented Programmi ng) Not built in; has the freedom to setup structures to act like objects. Lacking the ability to encapsulate(annouced private) is a big weakpoint Yes-polymorphism and inheritance, Classes. Appeared in 1972 1985 Execution Flow Top to Bottom Bottom to Top Garbage Collection Manual; allows better management of memory. Manual, you could manage the memory as C did, or use smart pointer , destructor to provide better and safer mechanism.According to your implementation, smart pointer can be zero runtime impact Usual filename extensions .c .cc, .cpp, .hh, .hpp By:-Gourav Kottawar
  • 7. Simple C++ program 7 #include <iostream.h> using namespace std; int main() { cout << "Hello World!" << endl; return 0; } By:-Gourav Kottawar
  • 8. Simple C++ program 8 #include <iostream> using namespace std; int main() { cout << "Hello World!" << endl; return 0; } By:-Gourav Kottawar
  • 9. Simple C++ program 9 #include <iostream> using namespace std; int main() { cout << "Hello World!" << endl; return 0; } By:-Gourav Kottawar
  • 10. namespace  Namespace is a new concept introduced by the ANSI C++ standards committee.  This defines a scope for the identifiers that are used in a program. For using the identifier defined in the namespace scope we must include the using directive, like Using namespace std;  Here, std is the namespace where ANSI C++ standard class libraries are defined.  All ANSI C++ programs must include this directive. This will bring all the identifiers defined in std to the current global scope.  Using and namespace are the new keyword of C++. 10 By:-Gourav Kottawar
  • 11. Simple C++ program 11 #include <iostream> using namespace std; int main() { cout << "Hello World!" << endl; return 0; } By:-Gourav Kottawar
  • 12. Simple C++ program 12 #include <iostream> using namespace std; int main() { cout << "Hello World!" << endl; return 0; } By:-Gourav Kottawar
  • 15. Applications of C++  Since C++ allow us to create hierarchy related objects, we can build special object-oriented libraries which can be used later by many programmers.  While C++ is able to map the real-world problem properly, the C part of C++ gives the language the ability to get closed to the machine-level details.  C++ programs are easily maintainable and expandable. When a new feature needs to be implemented, it is very easy to add to the existing structure of an object. • It is expected that C++ will replace C as a general- purpose language in the near future. 15 By:-Gourav Kottawar