SlideShare a Scribd company logo
1 of 26
• C++ ranks 4th in popularity according to 2016 IEEE spectrum
Top Programming Language ranking. Learning C++ is a wise
investment for all programmers.
• C++ is a general purpose, middle level programming language,
with high and low level programming capabilities, and this is
one of the most popular commercial programming languages.
What is C++ (programming language)?
• C++ is a statically-typed, free-form, (usually) compiled, multi-
paradigm, intermediate-level general-purpose middle-level
programming language.” In simple terms, C++ is a sophisticated,
efficient and a general-purpose programming language based on C.
It was developed by Bjarne Stroustrup in 1979.
• Many of today’s operating systems, system drivers, browsers and
games use C++ as their core language. This makes C++ one of the
most popular languages today. Since it is an enhanced/extended
version of C programming language, C and C++ are often denoted
together as C/C++.
HISTORY OF C++
• While Bjarne Stroustrup was working in AT&T Bell Labs in 1979, he faced
difficulties in analyzing UNIX kernel for distributed systems. The current
languages were either too slow or too low level. So, he set forward to
create a new language.
• For building this language, he chose C. Why C? Because it is a general
purpose language and is very efficient as well as fast in its operations. He
used his knowledge of object-oriented model from SIMULA and began
working on class extensions to C. His aim was to create a language with far
higher level of abstraction while retaining the efficiency of C. This new
programming language was named C withClasses, but was later renamed to
C++ (++ refers to the increment operator in C).
C++98
When C++ was first released in
1985, there were no official
standards released. It was only
until 1998 that C++ was first
standardized which was known
as C++98.
C++03
In 2003, a new version of C++
standard was published. C++03
wasn’t really a new standard
altogether but a bug fix release
identified with C++98 “to ensure
greater consistency and
portability”.
C++11 (C++0x)
The next major standard for C++ was
released in 2011 and it was named
C++11. Since, C++ committee was
sure this update would be released
within 2009, they unofficially named
it C++0x. Later, when they didn’t,
Stroustrup joked that C++0x went
hexadecimal - C++0xB (C++11). Nice
save.
C++14 (C++1y)
C++14 is the current iteration of C++
released in 2014. Like C++03, it
included mainly bug fixes and simple
improvements to C++11.
C++17 (C++1z)
The supposedly next iteration to C++ which is planned
to be rolled out in 2017. It is expected to have many
new features. Most of the features planned for this
version are already completed.
Features of C++
 C++ is fast
 C++ is statically typed
 C++ is a multi-paradigm programming language
 Object oriented programming with C++
 Power of standard library (Standard template
library - STL)
Benefits of C++ over C Language
• There is Stronger Type Checking in C++.
• All the OOPS features in C++ like Abstraction, Encapsulation,
Inheritance etc makes it more worthy and useful for programmers.
• C++ supports and allows user defined operators (i.e Operator
Overloading) and function overloading is also supported in it.
• Exception Handling is there in C++.
• The Concept of Virtual functions and also Constructors and Destructors
for Objects.
• Inline Functions in C++ instead of Macros in C language. Inline functions
make complete function body act like Macro, safely.
• Variables can be declared anywhere in the program in C++, but must be
declared before they are used.
5 Reasons Why you should learn C++?
C++ is irreplaceable
With the use of C++ in development of modern games, operating
systems, browsers, and much more, it is safe to say that C++ is
irreplaceable.
Many major applications like Adobe Products like Photoshop,
Illustrator, InDesign
Amazon - one of the biggest e-commerce sites
Autodesk products for Computer Aided Design
Facebook - social networking site are heavy C++ centric products.
Your first C++ program
Your first C++ program will be a “Hello World!” program.
You might have noticed “Hello World!” being the first program
while starting out with any programming language.
This is because: It is a standard check to see whether everything is
working fine or not.
There will be very less code to start with.
The less code makes it automatic for the beginners to get
acquainted with the language.
The code is enough to learn the basic syntax and semantics of the
language.
Example
#include <iostream>
using namespace std;
int main()
{
cout<<"Hello World!";]
return 0;
}
How the program works?
What is #include <iostream>?
This statement includes the header file into the application so that
you are able to use the operations included in them. Also, you can
create your own header files and include them in your program
using the #include.
What is iostream? iostream is what you call the header file. It is a
standard C++ input/output library file. It comes packaged with
the compiler/IDE and contain mechanisms to get the information
from the user and print same or added information to a file, screen
or any other media.
What is #include?
The #include iostream file, into the program. This ensures that now
you’re able to use the operations, iostream operations (like: taking
input from user, displaying output on the screen), in the program
What is using namespace std;”?
The statement is intuitive in itself, you are “using” the “namespace”
“std” in your file. We use the namespace std to make it easier to
reference operations included in that namespace.
If we hadn’t used the namespace, we’d have written std::cout instead
of cout. This tells the compiler that every cout is actually std::cout.
What’s a namespace?
It’s a region where your code resides. It limits or
expands the scope of your code to one or more files.
Why do you use namespace?
Like two persons can have the same name, variables
and functions in C++ can have same names as well. The
use of namespace is to avoid the confusion of which
variables/functions you are referencing to.
WHAT IS STD? :: std is a standard namespace used in C++.
SEMICOLON ”;” The semicolon is a terminal. It terminates a
statement. When missed or incorrectly used, it will cause a lot of issues
INT MAIN() { } As the name suggests, it is the main function of the
program. The code inside { } is called the body and is executed first when
you run your C++ program. It is one code that is mandatory in a C++
program. If you just have this line of code alone, your program will be valid.
cout << “Hello World!”;
This statement prints “Hello World!” onto the output screen.
The cout is an object of standard output stream. What this means is, it
outputs/prints the data after << , i.e. Hello World! into a stream (in this
case, the output screen).
What is a stream?
Stream is basically a sequence of objects, usually bytes. It can describe
files, input/output terminal, sockets, etc.
What is <<?
<< is the insertion operator used to write formatted data into the stream.
What is return 0;?
This statement returns 0 ‘zero’.
This is called a return statement. It isn’t mandatory to return
anything from the main() function but is rather a
convention. If not return, the compiler returns a status
automatically.
Why zero in return statement?
It denotes Exit status of the application that basically the
tells system “The program worked fine.”
Compile and run C++ programming on your OS
C++ is completely free and readily available on all platforms.
Follow the tutorial below for running C++ on your computer.
There are multiple compilers and text editors you can use to
run C++ programming. These may differ from system to
system.
If you want a quick start, you can also run C++ program
online.
Run C++ in Windows (XP, 7, 8 and 10)
To run C++ Programming in Windows, you’d need to
download Code::Blocks.
There are others available as well but Code::Blocks makes
installation a piece of cake.
It’s easy, simple and developer friendly.
To make this procedure even easier, follow this step by step
guide.
Go to the binary release download page of
Code:Blocks official site.
Under Windows XP / Vista / 7 / 8.x / 10 section, click the
link with mingw-setup highlighted row either from
Sourceforge.net or FossHub.
Open the Code::Blocks Setup file and follow the
instructions (Next > I agree > Next > Install); you don’t
need to change anything. This installs the Code::Blocks
with gnu gcc compiler, which is the best compiler to start
with for beginners.
Now, open Code::Blocks and go to File > New > Empty
file (Shortcut: Ctrl+Shift+N)
Write the C++ code and save the file
with .cpp extension. To save the file, go to File
> Save (Shortcut: Ctrl+S). Important: The
filename should end with .cpp extension, like:
hello.cpp, your-program-name.cpp
To run the program, go to Build > Build and
Run (Shortcut: F9). This will build the executable file and
run it.
If your program doesn’t run and if you see error message
"can't find compiler executable in your search path(GNU
GCC compiler)", go to Settings > Compiler > Toolchain
executables and click Auto-detect. This should solve the
issue in most cases.
End of Session – 1
Thank You…
© 2016 SMART Training Resources Pvt. Ltd.

More Related Content

What's hot

Migrating From Cpp To C Sharp
Migrating From Cpp To C SharpMigrating From Cpp To C Sharp
Migrating From Cpp To C SharpGanesh Samarthyam
 
What is c#
What is c#What is c#
What is c#shwet18
 
Programming in c_in_7_days
Programming in c_in_7_daysProgramming in c_in_7_days
Programming in c_in_7_daysAnkit Dubey
 
Chapter1 introduction it2
Chapter1 introduction it2Chapter1 introduction it2
Chapter1 introduction it2Kinglan Galon
 
Phpconf taiwan-2012
Phpconf taiwan-2012Phpconf taiwan-2012
Phpconf taiwan-2012Hash Lin
 
Porting To Symbian
Porting To SymbianPorting To Symbian
Porting To SymbianMark Wilcox
 
Web Programming UNIT VIII notes
Web Programming UNIT VIII notesWeb Programming UNIT VIII notes
Web Programming UNIT VIII notesBhavsingh Maloth
 
Prg 218 entire course
Prg 218 entire coursePrg 218 entire course
Prg 218 entire coursegrades4u
 
The seven pillars of aspnet
The seven pillars of aspnetThe seven pillars of aspnet
The seven pillars of aspnetNethaji Naidu
 
GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005Saleem Ansari
 
vpTech - Practical F# in Finance
vpTech - Practical F# in FinancevpTech - Practical F# in Finance
vpTech - Practical F# in FinanceAmin Khansari
 
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTHBhavsingh Maloth
 

What's hot (14)

Migrating From Cpp To C Sharp
Migrating From Cpp To C SharpMigrating From Cpp To C Sharp
Migrating From Cpp To C Sharp
 
What is c#
What is c#What is c#
What is c#
 
Programming in c_in_7_days
Programming in c_in_7_daysProgramming in c_in_7_days
Programming in c_in_7_days
 
Chapter1 introduction it2
Chapter1 introduction it2Chapter1 introduction it2
Chapter1 introduction it2
 
Lecture01 - Fundamental Programming with Python Language
Lecture01 - Fundamental Programming with Python LanguageLecture01 - Fundamental Programming with Python Language
Lecture01 - Fundamental Programming with Python Language
 
Phpconf taiwan-2012
Phpconf taiwan-2012Phpconf taiwan-2012
Phpconf taiwan-2012
 
Porting To Symbian
Porting To SymbianPorting To Symbian
Porting To Symbian
 
Web Programming UNIT VIII notes
Web Programming UNIT VIII notesWeb Programming UNIT VIII notes
Web Programming UNIT VIII notes
 
Prg 218 entire course
Prg 218 entire coursePrg 218 entire course
Prg 218 entire course
 
The seven pillars of aspnet
The seven pillars of aspnetThe seven pillars of aspnet
The seven pillars of aspnet
 
GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005
 
vpTech - Practical F# in Finance
vpTech - Practical F# in FinancevpTech - Practical F# in Finance
vpTech - Practical F# in Finance
 
Python programming
Python programmingPython programming
Python programming
 
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
 

Similar to Session 1 - c++ intro

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).docMayurWagh46
 
Introduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxIntroduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxNEHARAJPUT239591
 
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJIntroduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJmeharikiros2
 
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++ language basic
C++ language basicC++ language basic
C++ language basicWaqar Younis
 
His162013 140529214456-phpapp01
His162013 140529214456-phpapp01His162013 140529214456-phpapp01
His162013 140529214456-phpapp01Getachew Ganfur
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfAnassElHousni
 
C++ In One Day_Nho Vĩnh Share
C++ In One Day_Nho Vĩnh ShareC++ In One Day_Nho Vĩnh Share
C++ In One Day_Nho Vĩnh ShareNho Vĩnh
 
C plus plus for hackers it security
C plus plus for hackers it securityC plus plus for hackers it security
C plus plus for hackers it securityCESAR A. RUIZ 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 introductionAKR Education
 
Introduction to C Language (By: Shujaat Abbas)
Introduction to C Language (By: Shujaat Abbas)Introduction to C Language (By: Shujaat Abbas)
Introduction to C Language (By: Shujaat Abbas)Shujaat Abbas
 
Introduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to itIntroduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to itPushkarNiroula1
 
How to work with code blocks
How to work with code blocksHow to work with code blocks
How to work with code blocksTech Bikram
 

Similar to Session 1 - c++ intro (20)

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
 
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
 
C++Basics2022.pptx
C++Basics2022.pptxC++Basics2022.pptx
C++Basics2022.pptx
 
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++ language basic
C++ language basicC++ language basic
C++ language basic
 
Unit i
Unit iUnit i
Unit i
 
C++ for hackers
C++ for hackersC++ for hackers
C++ for hackers
 
His162013 140529214456-phpapp01
His162013 140529214456-phpapp01His162013 140529214456-phpapp01
His162013 140529214456-phpapp01
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdf
 
C
CC
C
 
C++ In One Day_Nho Vĩnh Share
C++ In One Day_Nho Vĩnh ShareC++ In One Day_Nho Vĩnh Share
C++ In One Day_Nho Vĩnh Share
 
C plus plus for hackers it security
C plus plus for hackers it securityC plus plus for hackers it security
C plus plus for hackers it security
 
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
 
Lab 1.pptx
Lab 1.pptxLab 1.pptx
Lab 1.pptx
 
The basics of c programming
The basics of c programmingThe basics of c programming
The basics of c programming
 
Introduction to C Language (By: Shujaat Abbas)
Introduction to C Language (By: Shujaat Abbas)Introduction to C Language (By: Shujaat Abbas)
Introduction to C Language (By: Shujaat Abbas)
 
Programming in c plus plus2
Programming in c plus plus2Programming in c plus plus2
Programming in c plus plus2
 
Introduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to itIntroduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to it
 
How to work with code blocks
How to work with code blocksHow to work with code blocks
How to work with code blocks
 

Recently uploaded

MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 

Recently uploaded (20)

Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 

Session 1 - c++ intro

  • 1.
  • 2. • C++ ranks 4th in popularity according to 2016 IEEE spectrum Top Programming Language ranking. Learning C++ is a wise investment for all programmers. • C++ is a general purpose, middle level programming language, with high and low level programming capabilities, and this is one of the most popular commercial programming languages.
  • 3. What is C++ (programming language)? • C++ is a statically-typed, free-form, (usually) compiled, multi- paradigm, intermediate-level general-purpose middle-level programming language.” In simple terms, C++ is a sophisticated, efficient and a general-purpose programming language based on C. It was developed by Bjarne Stroustrup in 1979. • Many of today’s operating systems, system drivers, browsers and games use C++ as their core language. This makes C++ one of the most popular languages today. Since it is an enhanced/extended version of C programming language, C and C++ are often denoted together as C/C++.
  • 4. HISTORY OF C++ • While Bjarne Stroustrup was working in AT&T Bell Labs in 1979, he faced difficulties in analyzing UNIX kernel for distributed systems. The current languages were either too slow or too low level. So, he set forward to create a new language. • For building this language, he chose C. Why C? Because it is a general purpose language and is very efficient as well as fast in its operations. He used his knowledge of object-oriented model from SIMULA and began working on class extensions to C. His aim was to create a language with far higher level of abstraction while retaining the efficiency of C. This new programming language was named C withClasses, but was later renamed to C++ (++ refers to the increment operator in C).
  • 5. C++98 When C++ was first released in 1985, there were no official standards released. It was only until 1998 that C++ was first standardized which was known as C++98. C++03 In 2003, a new version of C++ standard was published. C++03 wasn’t really a new standard altogether but a bug fix release identified with C++98 “to ensure greater consistency and portability”. C++11 (C++0x) The next major standard for C++ was released in 2011 and it was named C++11. Since, C++ committee was sure this update would be released within 2009, they unofficially named it C++0x. Later, when they didn’t, Stroustrup joked that C++0x went hexadecimal - C++0xB (C++11). Nice save. C++14 (C++1y) C++14 is the current iteration of C++ released in 2014. Like C++03, it included mainly bug fixes and simple improvements to C++11.
  • 6. C++17 (C++1z) The supposedly next iteration to C++ which is planned to be rolled out in 2017. It is expected to have many new features. Most of the features planned for this version are already completed.
  • 7. Features of C++  C++ is fast  C++ is statically typed  C++ is a multi-paradigm programming language  Object oriented programming with C++  Power of standard library (Standard template library - STL)
  • 8. Benefits of C++ over C Language • There is Stronger Type Checking in C++. • All the OOPS features in C++ like Abstraction, Encapsulation, Inheritance etc makes it more worthy and useful for programmers. • C++ supports and allows user defined operators (i.e Operator Overloading) and function overloading is also supported in it. • Exception Handling is there in C++. • The Concept of Virtual functions and also Constructors and Destructors for Objects. • Inline Functions in C++ instead of Macros in C language. Inline functions make complete function body act like Macro, safely. • Variables can be declared anywhere in the program in C++, but must be declared before they are used.
  • 9. 5 Reasons Why you should learn C++? C++ is irreplaceable With the use of C++ in development of modern games, operating systems, browsers, and much more, it is safe to say that C++ is irreplaceable. Many major applications like Adobe Products like Photoshop, Illustrator, InDesign Amazon - one of the biggest e-commerce sites Autodesk products for Computer Aided Design Facebook - social networking site are heavy C++ centric products.
  • 10. Your first C++ program Your first C++ program will be a “Hello World!” program. You might have noticed “Hello World!” being the first program while starting out with any programming language. This is because: It is a standard check to see whether everything is working fine or not. There will be very less code to start with. The less code makes it automatic for the beginners to get acquainted with the language. The code is enough to learn the basic syntax and semantics of the language.
  • 11. Example #include <iostream> using namespace std; int main() { cout<<"Hello World!";] return 0; }
  • 12. How the program works? What is #include <iostream>? This statement includes the header file into the application so that you are able to use the operations included in them. Also, you can create your own header files and include them in your program using the #include. What is iostream? iostream is what you call the header file. It is a standard C++ input/output library file. It comes packaged with the compiler/IDE and contain mechanisms to get the information from the user and print same or added information to a file, screen or any other media.
  • 13. What is #include? The #include iostream file, into the program. This ensures that now you’re able to use the operations, iostream operations (like: taking input from user, displaying output on the screen), in the program What is using namespace std;”? The statement is intuitive in itself, you are “using” the “namespace” “std” in your file. We use the namespace std to make it easier to reference operations included in that namespace. If we hadn’t used the namespace, we’d have written std::cout instead of cout. This tells the compiler that every cout is actually std::cout.
  • 14. What’s a namespace? It’s a region where your code resides. It limits or expands the scope of your code to one or more files. Why do you use namespace? Like two persons can have the same name, variables and functions in C++ can have same names as well. The use of namespace is to avoid the confusion of which variables/functions you are referencing to.
  • 15. WHAT IS STD? :: std is a standard namespace used in C++. SEMICOLON ”;” The semicolon is a terminal. It terminates a statement. When missed or incorrectly used, it will cause a lot of issues INT MAIN() { } As the name suggests, it is the main function of the program. The code inside { } is called the body and is executed first when you run your C++ program. It is one code that is mandatory in a C++ program. If you just have this line of code alone, your program will be valid.
  • 16. cout << “Hello World!”; This statement prints “Hello World!” onto the output screen. The cout is an object of standard output stream. What this means is, it outputs/prints the data after << , i.e. Hello World! into a stream (in this case, the output screen). What is a stream? Stream is basically a sequence of objects, usually bytes. It can describe files, input/output terminal, sockets, etc. What is <<? << is the insertion operator used to write formatted data into the stream.
  • 17. What is return 0;? This statement returns 0 ‘zero’. This is called a return statement. It isn’t mandatory to return anything from the main() function but is rather a convention. If not return, the compiler returns a status automatically. Why zero in return statement? It denotes Exit status of the application that basically the tells system “The program worked fine.”
  • 18. Compile and run C++ programming on your OS C++ is completely free and readily available on all platforms. Follow the tutorial below for running C++ on your computer. There are multiple compilers and text editors you can use to run C++ programming. These may differ from system to system. If you want a quick start, you can also run C++ program online.
  • 19. Run C++ in Windows (XP, 7, 8 and 10) To run C++ Programming in Windows, you’d need to download Code::Blocks. There are others available as well but Code::Blocks makes installation a piece of cake. It’s easy, simple and developer friendly. To make this procedure even easier, follow this step by step guide.
  • 20. Go to the binary release download page of Code:Blocks official site.
  • 21. Under Windows XP / Vista / 7 / 8.x / 10 section, click the link with mingw-setup highlighted row either from Sourceforge.net or FossHub. Open the Code::Blocks Setup file and follow the instructions (Next > I agree > Next > Install); you don’t need to change anything. This installs the Code::Blocks with gnu gcc compiler, which is the best compiler to start with for beginners. Now, open Code::Blocks and go to File > New > Empty file (Shortcut: Ctrl+Shift+N)
  • 22.
  • 23. Write the C++ code and save the file with .cpp extension. To save the file, go to File > Save (Shortcut: Ctrl+S). Important: The filename should end with .cpp extension, like: hello.cpp, your-program-name.cpp
  • 24.
  • 25. To run the program, go to Build > Build and Run (Shortcut: F9). This will build the executable file and run it. If your program doesn’t run and if you see error message "can't find compiler executable in your search path(GNU GCC compiler)", go to Settings > Compiler > Toolchain executables and click Auto-detect. This should solve the issue in most cases.
  • 26. End of Session – 1 Thank You… © 2016 SMART Training Resources Pvt. Ltd.