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

What's hot

C++ language basic
C++ language basicC++ language basic
C++ language basic
Waqar Younis
 
C++ How to program
C++ How to programC++ How to program
C++ How to program
Mohammad Golyani
 
Learn c++ Programming Language
Learn c++ Programming LanguageLearn c++ Programming Language
Learn c++ Programming Language
Steve Johnson
 
C++11
C++11C++11
45 Days C++ Programming Language Training in Ambala
45 Days C++ Programming Language Training in Ambala45 Days C++ Programming Language Training in Ambala
45 Days C++ Programming Language Training in Ambala
jatin batra
 
C++ Presentation
C++ PresentationC++ Presentation
C++ Presentation
Carson Wilber
 
Cs1123 3 c++ overview
Cs1123 3 c++ overviewCs1123 3 c++ overview
Cs1123 3 c++ overviewTAlha MAlik
 
Structure of C++ - R.D.Sivakumar
Structure of C++ - R.D.SivakumarStructure of C++ - R.D.Sivakumar
Structure of C++ - R.D.Sivakumar
Sivakumar R D .
 
Introduction to C++
Introduction to C++Introduction to C++
Introduction to C++
Sikder Tahsin Al-Amin
 
Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)
Geeks Anonymes
 
Summary of C++17 features
Summary of C++17 featuresSummary of C++17 features
Summary of C++17 features
Bartlomiej Filipek
 
Diff between c and c++
Diff between c and c++Diff between c and c++
Diff between c and c++
VishrudhMamidala
 
C++11 concurrency
C++11 concurrencyC++11 concurrency
C++11 concurrencyxu liwei
 
C introduction by thooyavan
C introduction by  thooyavanC introduction by  thooyavan
C introduction by thooyavan
Thooyavan Venkatachalam
 
C++11: Feel the New Language
C++11: Feel the New LanguageC++11: Feel the New Language
C++11: Feel the New Languagemspline
 
C++17 introduction - Meetup @EtixLabs
C++17 introduction - Meetup @EtixLabsC++17 introduction - Meetup @EtixLabs
C++17 introduction - Meetup @EtixLabs
Stephane Gleizes
 
Modern C++
Modern C++Modern C++
Modern C++
Michael Clark
 
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
Chris Adamson
 
C Theory
C TheoryC Theory
C Theory
Shyam Khant
 
C++11
C++11C++11
C++11
ppd1961
 

What's hot (20)

C++ language basic
C++ language basicC++ language basic
C++ language basic
 
C++ How to program
C++ How to programC++ How to program
C++ How to program
 
Learn c++ Programming Language
Learn c++ Programming LanguageLearn c++ Programming Language
Learn c++ Programming Language
 
C++11
C++11C++11
C++11
 
45 Days C++ Programming Language Training in Ambala
45 Days C++ Programming Language Training in Ambala45 Days C++ Programming Language Training in Ambala
45 Days C++ Programming Language Training in Ambala
 
C++ Presentation
C++ PresentationC++ Presentation
C++ Presentation
 
Cs1123 3 c++ overview
Cs1123 3 c++ overviewCs1123 3 c++ overview
Cs1123 3 c++ overview
 
Structure of C++ - R.D.Sivakumar
Structure of C++ - R.D.SivakumarStructure of C++ - R.D.Sivakumar
Structure of C++ - R.D.Sivakumar
 
Introduction to C++
Introduction to C++Introduction to C++
Introduction to C++
 
Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)
 
Summary of C++17 features
Summary of C++17 featuresSummary of C++17 features
Summary of C++17 features
 
Diff between c and c++
Diff between c and c++Diff between c and c++
Diff between c and c++
 
C++11 concurrency
C++11 concurrencyC++11 concurrency
C++11 concurrency
 
C introduction by thooyavan
C introduction by  thooyavanC introduction by  thooyavan
C introduction by thooyavan
 
C++11: Feel the New Language
C++11: Feel the New LanguageC++11: Feel the New Language
C++11: Feel the New Language
 
C++17 introduction - Meetup @EtixLabs
C++17 introduction - Meetup @EtixLabsC++17 introduction - Meetup @EtixLabs
C++17 introduction - Meetup @EtixLabs
 
Modern C++
Modern C++Modern C++
Modern C++
 
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
 
C Theory
C TheoryC Theory
C Theory
 
C++11
C++11C++11
C++11
 

Similar to basics of c++

Unit 1 of c++ part 1 basic introduction
Unit 1 of c++ part 1 basic introductionUnit 1 of c++ part 1 basic introduction
Unit 1 of c++ part 1 basic introduction
AKR Education
 
Introduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).docIntroduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).doc
MayurWagh46
 
C++ helps you to format the I/O operations like determining the number of dig...
C++ helps you to format the I/O operations like determining the number of dig...C++ helps you to format the I/O operations like determining the number of dig...
C++ helps you to format the I/O operations like determining the number of dig...
bhargavi804095
 
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
bhargavi804095
 
Introduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxIntroduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptx
NEHARAJPUT239591
 
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJIntroduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
meharikiros2
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdf
AnassElHousni
 
C++Basics2022.pptx
C++Basics2022.pptxC++Basics2022.pptx
C++Basics2022.pptx
Danielle780357
 
1. Introduction to C++ and brief history
1. Introduction to C++ and brief history1. Introduction to C++ and brief history
1. Introduction to C++ and brief history
Ahmad177077
 
Object oriented programming c++
Object oriented programming c++Object oriented programming c++
Object oriented programming c++
Ankur Pandey
 
object oriented programming language fundamentals
object oriented programming language fundamentalsobject oriented programming language fundamentals
object oriented programming language fundamentals
ChaithraCSHirematt
 
Session 1 - c++ intro
Session   1 - c++ introSession   1 - c++ intro
Session 1 - c++ intro
VijayaNagarajan5
 
Summer training PPT Manasv Singharia.pptx
Summer training PPT Manasv Singharia.pptxSummer training PPT Manasv Singharia.pptx
Summer training PPT Manasv Singharia.pptx
shokeenk14
 
Programming in c plus plus2
Programming in c plus plus2Programming in c plus plus2
Programming in c plus plus2
AA Coaching Academy
 
C++ vs C#
C++ vs C#C++ vs C#
C++ vs C#
sudipv
 
Lecture 11
Lecture 11Lecture 11
Lecture 11
Abbas Ajmal
 
Object oriented slides
Object oriented slidesObject oriented slides
Object oriented slides
ahad nadeem
 
Introduction to C++
Introduction to C++Introduction to C++
Introduction to C++
Manoj Kumar
 

Similar to basics of c++ (20)

Unit 1 of c++ part 1 basic introduction
Unit 1 of c++ part 1 basic introductionUnit 1 of c++ part 1 basic introduction
Unit 1 of c++ part 1 basic introduction
 
Introduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).docIntroduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).doc
 
C++ helps you to format the I/O operations like determining the number of dig...
C++ helps you to format the I/O operations like determining the number of dig...C++ helps you to format the I/O operations like determining the number of dig...
C++ helps you to format the I/O operations like determining the number of dig...
 
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
 
Introduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxIntroduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptx
 
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJIntroduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdf
 
C++Basics2022.pptx
C++Basics2022.pptxC++Basics2022.pptx
C++Basics2022.pptx
 
Unit i
Unit iUnit i
Unit i
 
1. Introduction to C++ and brief history
1. Introduction to C++ and brief history1. Introduction to C++ and brief history
1. Introduction to C++ and brief history
 
Object oriented programming c++
Object oriented programming c++Object oriented programming c++
Object oriented programming c++
 
object oriented programming language fundamentals
object oriented programming language fundamentalsobject oriented programming language fundamentals
object oriented programming language fundamentals
 
Session 1 - c++ intro
Session   1 - c++ introSession   1 - c++ intro
Session 1 - c++ intro
 
Summer training PPT Manasv Singharia.pptx
Summer training PPT Manasv Singharia.pptxSummer training PPT Manasv Singharia.pptx
Summer training PPT Manasv Singharia.pptx
 
Programming in c plus plus2
Programming in c plus plus2Programming in c plus plus2
Programming in c plus plus2
 
Oops index
Oops indexOops index
Oops index
 
C++ vs C#
C++ vs C#C++ vs C#
C++ vs C#
 
Lecture 11
Lecture 11Lecture 11
Lecture 11
 
Object oriented slides
Object oriented slidesObject oriented slides
Object oriented slides
 
Introduction to C++
Introduction to C++Introduction to C++
Introduction to C++
 

More from gourav kottawar

operator overloading & type conversion in cpp
operator overloading & type conversion in cppoperator overloading & type conversion in cpp
operator overloading & type conversion in cpp
gourav kottawar
 
constructor & destructor in cpp
constructor & destructor in cppconstructor & destructor in cpp
constructor & destructor in cpp
gourav kottawar
 
classes & objects in cpp
classes & objects in cppclasses & objects in cpp
classes & objects in cpp
gourav kottawar
 
expression in cpp
expression in cppexpression in cpp
expression in cpp
gourav kottawar
 
working file handling in cpp overview
working file handling in cpp overviewworking file handling in cpp overview
working file handling in cpp overview
gourav kottawar
 
pointers, virtual functions and polymorphisms in c++ || in cpp
pointers, virtual functions and polymorphisms in c++ || in cpppointers, virtual functions and polymorphisms in c++ || in cpp
pointers, virtual functions and polymorphisms in c++ || in cpp
gourav kottawar
 
exception handling in cpp
exception handling in cppexception handling in cpp
exception handling in cpp
gourav kottawar
 
cpp input & output system basics
cpp input & output system basicscpp input & output system basics
cpp input & output system basics
gourav kottawar
 
operator overloading & type conversion in cpp over view || c++
operator overloading & type conversion in cpp over view || c++operator overloading & type conversion in cpp over view || c++
operator overloading & type conversion in cpp over view || c++
gourav kottawar
 
constructor & destructor in cpp
constructor & destructor in cppconstructor & destructor in cpp
constructor & destructor in cpp
gourav kottawar
 
basics of c++
basics of c++basics of c++
basics of c++
gourav kottawar
 
classes & objects in cpp overview
classes & objects in cpp overviewclasses & objects in cpp overview
classes & objects in cpp overview
gourav kottawar
 
expression in cpp
expression in cppexpression in cpp
expression in cpp
gourav kottawar
 
SQL || overview and detailed information about Sql
SQL || overview and detailed information about SqlSQL || overview and detailed information about Sql
SQL || overview and detailed information about Sql
gourav kottawar
 
SQL querys in detail || Sql query slides
SQL querys in detail || Sql query slidesSQL querys in detail || Sql query slides
SQL querys in detail || Sql query slides
gourav kottawar
 
Rrelational algebra in dbms overview
Rrelational algebra in dbms overviewRrelational algebra in dbms overview
Rrelational algebra in dbms overview
gourav kottawar
 
overview of database concept
overview of database conceptoverview of database concept
overview of database concept
gourav kottawar
 
Relational Model in dbms & sql database
Relational Model in dbms & sql databaseRelational Model in dbms & sql database
Relational Model in dbms & sql database
gourav kottawar
 
DBMS information in detail || Dbms (lab) ppt
DBMS information in detail || Dbms (lab) pptDBMS information in detail || Dbms (lab) ppt
DBMS information in detail || Dbms (lab) ppt
gourav kottawar
 
security and privacy in dbms and in sql database
security and privacy in dbms and in sql databasesecurity and privacy in dbms and in sql database
security and privacy in dbms and in sql database
gourav kottawar
 

More from gourav kottawar (20)

operator overloading & type conversion in cpp
operator overloading & type conversion in cppoperator overloading & type conversion in cpp
operator overloading & type conversion in cpp
 
constructor & destructor in cpp
constructor & destructor in cppconstructor & destructor in cpp
constructor & destructor in cpp
 
classes & objects in cpp
classes & objects in cppclasses & objects in cpp
classes & objects in cpp
 
expression in cpp
expression in cppexpression in cpp
expression in cpp
 
working file handling in cpp overview
working file handling in cpp overviewworking file handling in cpp overview
working file handling in cpp overview
 
pointers, virtual functions and polymorphisms in c++ || in cpp
pointers, virtual functions and polymorphisms in c++ || in cpppointers, virtual functions and polymorphisms in c++ || in cpp
pointers, virtual functions and polymorphisms in c++ || in cpp
 
exception handling in cpp
exception handling in cppexception handling in cpp
exception handling in cpp
 
cpp input & output system basics
cpp input & output system basicscpp input & output system basics
cpp input & output system basics
 
operator overloading & type conversion in cpp over view || c++
operator overloading & type conversion in cpp over view || c++operator overloading & type conversion in cpp over view || c++
operator overloading & type conversion in cpp over view || c++
 
constructor & destructor in cpp
constructor & destructor in cppconstructor & destructor in cpp
constructor & destructor in cpp
 
basics of c++
basics of c++basics of c++
basics of c++
 
classes & objects in cpp overview
classes & objects in cpp overviewclasses & objects in cpp overview
classes & objects in cpp overview
 
expression in cpp
expression in cppexpression in cpp
expression in cpp
 
SQL || overview and detailed information about Sql
SQL || overview and detailed information about SqlSQL || overview and detailed information about Sql
SQL || overview and detailed information about Sql
 
SQL querys in detail || Sql query slides
SQL querys in detail || Sql query slidesSQL querys in detail || Sql query slides
SQL querys in detail || Sql query slides
 
Rrelational algebra in dbms overview
Rrelational algebra in dbms overviewRrelational algebra in dbms overview
Rrelational algebra in dbms overview
 
overview of database concept
overview of database conceptoverview of database concept
overview of database concept
 
Relational Model in dbms & sql database
Relational Model in dbms & sql databaseRelational Model in dbms & sql database
Relational Model in dbms & sql database
 
DBMS information in detail || Dbms (lab) ppt
DBMS information in detail || Dbms (lab) pptDBMS information in detail || Dbms (lab) ppt
DBMS information in detail || Dbms (lab) ppt
 
security and privacy in dbms and in sql database
security and privacy in dbms and in sql databasesecurity and privacy in dbms and in sql database
security and privacy in dbms and in sql database
 

Recently uploaded

678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 

Recently uploaded (20)

678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.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