SlideShare a Scribd company logo
 What is “C++” ?
 Benefits of C++ over C language
 Object Oriented Programming in C++
 Datatypes in C++
 Operators in C++
 Variables in C++
 Syntax & Structure of C++ Programme
 Basic example of C++
 Creating Classes in C++
 Controlling structures in C++
 Example of C++
 References
 C++ is an extension of C programming and was
developed by Bjarne Stroustup at AT & T’s Bell
Laboratory in USA in 1980s.
 C++ is an intermediate level language, as it
comprises both high level and low level language
features.
 C++ is a free form, general-purpose language.
 C++ is an Object Oriented Programming
language but is not purely Object Oriented
because of its features like Friend and Virtual
 All the OOP’s 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.
 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.
 Object-oriented means a
term which is interpreted
differently by different
people.
 Programs are divided into
Objects.
 Data is hidden & not
accessible by external
functions.
 New data & functions can
be added whenever
necessary.
Object
Class
Data Encapsulation
Data Abstraction
Inheritance
Polymorphism
Dynamic Binding
Message Passing
Concepts
1. Object: They are the basic run-time entities, they represent a
user-defined data.
2. Class: It is a collection of objects of similar type, they’re user
defined data types.
3. Data Encapsulation: Wrapping up of data & function into a
single unit called Class.
4. Data Abstraction: It is the act of representing essential features
without including the background details.
5. Inheritance: The mechanism of deriving a new class from an old
one i.e. objects of one class acquire the properties of objects of
another class (reusability of code).
6. Polymorphism: It is the ability to take more than one form.
7. Dynamic Binding: It refers to any code that is called is not
known until runtime.
8. Message passing: A set of objects that communicate with each
other.
User-Defined type Built-in type Derived type
Structure
Union
Class
Enumeration
Array
Function
Pointer
Reference
Void
Integral
type
Floating
type
Char(1)
Int(2) & long int(4)
Double(8)
Float(4)
 Assignment(=): Assign the values.
 Mathematical(+,-,*,/,%): Mathematical operations.
 Relational(< >,<=,>=,++,!=): Comparison.
 Logical(&&,||): Combine 2 different expression.
 Bitwise(&,|,^,~): Change individual bits into number.
 Shift(<<,>>,>>>): Shift bits of any variable.
 Unary(++,--): Used with one operand only.
 Ternary(?:): Used with 3 operands.
 Comma(,): Separation of variables and expressions.
 In C++, the declaration of variable is allowed
anywhere in the scope i.e. Variables can be
declared right at the place of its use.
 There are total 64 keywords in C++ given by ANSI.
Scope of Variables
All the variables have their area of functioning, and
out of that boundary they don't hold their value, this
boundary is called scope of the variable.
 Global Variables
 Local variables
 Those variables which are
once declared and can be
used throughout the lifetime
of the program by any class
or any function.
 They must be declared
outside the main() function.
 Those variables which exist
only between the curly
braces, in which its declared.
 Outside that they are
unavailable and leads to
compile time error.
Cout<<: Output operator
Cin>>:Intput operator
OUTPUT
 Class is a collection of objects of similar type.
 Classes are user defined datatypes.
 Once class is defined, then object is created & member fucntions are used.
Sequence Selection Loop
Action 1
Action 2
Action 3
Entry
Exit
Straight line
Switch
If--else
While
Do while
For
Condition
Is
Tested
(True/False) Loops
runs
In
it
Action 1 Action 2
Action 3
Entry
Exit
Condition
 If-else
 Switch
True False
Action 1
Entry
Exit
Condition
 Do-while
 While
 For
True
False
Action 2
Loop
 Kanetkar, P.Y. “Let Us C++” Seventh Edition
2007, pp. 34-37, BPB Publications, New
Delhi-1.
 Balaguruswamy, E. “Object Oriented
Programming with C++” Eighth Edition 2016,
pp. 14-40, Mc Graw Hill Education (India)
Private Limited, New Delhi-110016.
Introduction to C++ Programming

More Related Content

What's hot

Object-Oriented Programming Using C++
Object-Oriented Programming Using C++Object-Oriented Programming Using C++
Object-Oriented Programming Using C++
Salahaddin University-Erbil
 
2CPP08 - Overloading and Overriding
2CPP08 - Overloading and Overriding2CPP08 - Overloading and Overriding
2CPP08 - Overloading and Overriding
Michael Heron
 
4- Inheritance, Aggregation, Encapsulation and Overloading
4- Inheritance, Aggregation, Encapsulation and Overloading4- Inheritance, Aggregation, Encapsulation and Overloading
4- Inheritance, Aggregation, Encapsulation and Overloading
Ghadeer AlHasan
 
Object oriented concepts
Object oriented conceptsObject oriented concepts
Object oriented concepts
Pranali Chaudhari
 
Oops
OopsOops
C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#
Dr.Neeraj Kumar Pandey
 
Recursion CBSE Class 12
Recursion CBSE Class 12Recursion CBSE Class 12
Recursion CBSE Class 12
chinthala Vijaya Kumar
 
Class and object
Class and objectClass and object
Class and object
Prof. Dr. K. Adisesha
 
C by balaguruswami - e.balagurusamy
C   by balaguruswami - e.balagurusamyC   by balaguruswami - e.balagurusamy
C by balaguruswami - e.balagurusamy
Srichandan Sobhanayak
 
Keywords in python
Keywords in pythonKeywords in python
Keywords in python
PushpakBhoge
 
C++ classes
C++ classesC++ classes
C++ classes
imhammadali
 
Inheritance
InheritanceInheritance
Inheritance
Pranali Chaudhari
 
Inheritance
InheritanceInheritance
Inheritance
Jaya Kumari
 
Inheritance, friend function, virtual function, polymorphism
Inheritance, friend function, virtual function, polymorphismInheritance, friend function, virtual function, polymorphism
Inheritance, friend function, virtual function, polymorphism
Jawad Khan
 
Polymorphism in oop
Polymorphism in oopPolymorphism in oop
Polymorphism in oop
MustafaIbrahimy
 
Doppl development iteration #2
Doppl development   iteration #2Doppl development   iteration #2
Doppl development iteration #2
Diego Perini
 
Learn Concept of Class and Object in C# Part 3
Learn Concept of Class and Object in C#  Part 3Learn Concept of Class and Object in C#  Part 3
Learn Concept of Class and Object in C# Part 3
C# Learning Classes
 
Object oriented programming in C++
Object oriented programming in C++Object oriented programming in C++
Object oriented programming in C++
jehan1987
 
Static and Dynamic polymorphism in C++
Static and Dynamic polymorphism in C++Static and Dynamic polymorphism in C++
Static and Dynamic polymorphism in C++
Anil Bapat
 

What's hot (20)

Object-Oriented Programming Using C++
Object-Oriented Programming Using C++Object-Oriented Programming Using C++
Object-Oriented Programming Using C++
 
2CPP08 - Overloading and Overriding
2CPP08 - Overloading and Overriding2CPP08 - Overloading and Overriding
2CPP08 - Overloading and Overriding
 
4- Inheritance, Aggregation, Encapsulation and Overloading
4- Inheritance, Aggregation, Encapsulation and Overloading4- Inheritance, Aggregation, Encapsulation and Overloading
4- Inheritance, Aggregation, Encapsulation and Overloading
 
Object oriented concepts
Object oriented conceptsObject oriented concepts
Object oriented concepts
 
Oops
OopsOops
Oops
 
C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#
 
Recursion CBSE Class 12
Recursion CBSE Class 12Recursion CBSE Class 12
Recursion CBSE Class 12
 
Class and object
Class and objectClass and object
Class and object
 
C by balaguruswami - e.balagurusamy
C   by balaguruswami - e.balagurusamyC   by balaguruswami - e.balagurusamy
C by balaguruswami - e.balagurusamy
 
Keywords in python
Keywords in pythonKeywords in python
Keywords in python
 
C++ classes
C++ classesC++ classes
C++ classes
 
My c++
My c++My c++
My c++
 
Inheritance
InheritanceInheritance
Inheritance
 
Inheritance
InheritanceInheritance
Inheritance
 
Inheritance, friend function, virtual function, polymorphism
Inheritance, friend function, virtual function, polymorphismInheritance, friend function, virtual function, polymorphism
Inheritance, friend function, virtual function, polymorphism
 
Polymorphism in oop
Polymorphism in oopPolymorphism in oop
Polymorphism in oop
 
Doppl development iteration #2
Doppl development   iteration #2Doppl development   iteration #2
Doppl development iteration #2
 
Learn Concept of Class and Object in C# Part 3
Learn Concept of Class and Object in C#  Part 3Learn Concept of Class and Object in C#  Part 3
Learn Concept of Class and Object in C# Part 3
 
Object oriented programming in C++
Object oriented programming in C++Object oriented programming in C++
Object oriented programming in C++
 
Static and Dynamic polymorphism in C++
Static and Dynamic polymorphism in C++Static and Dynamic polymorphism in C++
Static and Dynamic polymorphism in C++
 

Similar to Introduction to C++ Programming

Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++
Amresh Raj
 
C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1
ReKruiTIn.com
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]
Rome468
 
C++
C++C++
C++
Rome468
 
7.-Download_CS201-Solved-Subjective-with-Reference-by-Aqib.doc
7.-Download_CS201-Solved-Subjective-with-Reference-by-Aqib.doc7.-Download_CS201-Solved-Subjective-with-Reference-by-Aqib.doc
7.-Download_CS201-Solved-Subjective-with-Reference-by-Aqib.doc
abdulhaq467432
 
Tcs NQTExam technical questions
Tcs NQTExam technical questionsTcs NQTExam technical questions
Tcs NQTExam technical questions
AniketBhandare2
 
The smartpath information systems c plus plus
The smartpath information systems  c plus plusThe smartpath information systems  c plus plus
The smartpath information systems c plus plus
The Smartpath Information Systems,Bhilai,Durg,Chhattisgarh.
 
Unit 5.ppt
Unit 5.pptUnit 5.ppt
C++ Langauage Training in Ambala ! BATRA COMPUTER CENTRE
C++  Langauage Training in Ambala ! BATRA COMPUTER CENTREC++  Langauage Training in Ambala ! BATRA COMPUTER CENTRE
C++ Langauage Training in Ambala ! BATRA COMPUTER CENTRE
jatin batra
 
Summer Training Project On C++
Summer Training Project On  C++Summer Training Project On  C++
Summer Training Project On C++
KAUSHAL KUMAR JHA
 
C++ programing lanuage
C++ programing lanuageC++ programing lanuage
C++ programing lanuage
Nimai Chand Das
 
I assignmnt(oops)
I assignmnt(oops)I assignmnt(oops)
I assignmnt(oops)Jay Patel
 
C++ programming introduction
C++ programming introductionC++ programming introduction
C++ programming introduction
sandeep54552
 
Technical_Interview_Questions.pdf
Technical_Interview_Questions.pdfTechnical_Interview_Questions.pdf
Technical_Interview_Questions.pdf
adityashukla939020
 
C++ Version 2
C++  Version 2C++  Version 2
C++ Version 2
JIGAR MAKHIJA
 
C++ Object Oriented Programming
C++  Object Oriented ProgrammingC++  Object Oriented Programming
C++ Object Oriented Programming
Gamindu Udayanga
 
C questions
C questionsC questions
C questions
parm112
 
1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers
Akash Gawali
 

Similar to Introduction to C++ Programming (20)

Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++
 
C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]
 
C++
C++C++
C++
 
Intervies
InterviesIntervies
Intervies
 
Question bank unit i
Question bank unit iQuestion bank unit i
Question bank unit i
 
7.-Download_CS201-Solved-Subjective-with-Reference-by-Aqib.doc
7.-Download_CS201-Solved-Subjective-with-Reference-by-Aqib.doc7.-Download_CS201-Solved-Subjective-with-Reference-by-Aqib.doc
7.-Download_CS201-Solved-Subjective-with-Reference-by-Aqib.doc
 
Tcs NQTExam technical questions
Tcs NQTExam technical questionsTcs NQTExam technical questions
Tcs NQTExam technical questions
 
The smartpath information systems c plus plus
The smartpath information systems  c plus plusThe smartpath information systems  c plus plus
The smartpath information systems c plus plus
 
Unit 5.ppt
Unit 5.pptUnit 5.ppt
Unit 5.ppt
 
C++ Langauage Training in Ambala ! BATRA COMPUTER CENTRE
C++  Langauage Training in Ambala ! BATRA COMPUTER CENTREC++  Langauage Training in Ambala ! BATRA COMPUTER CENTRE
C++ Langauage Training in Ambala ! BATRA COMPUTER CENTRE
 
Summer Training Project On C++
Summer Training Project On  C++Summer Training Project On  C++
Summer Training Project On C++
 
C++ programing lanuage
C++ programing lanuageC++ programing lanuage
C++ programing lanuage
 
I assignmnt(oops)
I assignmnt(oops)I assignmnt(oops)
I assignmnt(oops)
 
C++ programming introduction
C++ programming introductionC++ programming introduction
C++ programming introduction
 
Technical_Interview_Questions.pdf
Technical_Interview_Questions.pdfTechnical_Interview_Questions.pdf
Technical_Interview_Questions.pdf
 
C++ Version 2
C++  Version 2C++  Version 2
C++ Version 2
 
C++ Object Oriented Programming
C++  Object Oriented ProgrammingC++  Object Oriented Programming
C++ Object Oriented Programming
 
C questions
C questionsC questions
C questions
 
1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers
 

Recently uploaded

From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 

Recently uploaded (20)

From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 

Introduction to C++ Programming

  • 1.
  • 2.  What is “C++” ?  Benefits of C++ over C language  Object Oriented Programming in C++  Datatypes in C++  Operators in C++  Variables in C++  Syntax & Structure of C++ Programme  Basic example of C++  Creating Classes in C++  Controlling structures in C++  Example of C++  References
  • 3.  C++ is an extension of C programming and was developed by Bjarne Stroustup at AT & T’s Bell Laboratory in USA in 1980s.  C++ is an intermediate level language, as it comprises both high level and low level language features.  C++ is a free form, general-purpose language.  C++ is an Object Oriented Programming language but is not purely Object Oriented because of its features like Friend and Virtual
  • 4.  All the OOP’s 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.  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.  Object-oriented means a term which is interpreted differently by different people.  Programs are divided into Objects.  Data is hidden & not accessible by external functions.  New data & functions can be added whenever necessary. Object Class Data Encapsulation Data Abstraction Inheritance Polymorphism Dynamic Binding Message Passing Concepts
  • 6. 1. Object: They are the basic run-time entities, they represent a user-defined data. 2. Class: It is a collection of objects of similar type, they’re user defined data types. 3. Data Encapsulation: Wrapping up of data & function into a single unit called Class. 4. Data Abstraction: It is the act of representing essential features without including the background details. 5. Inheritance: The mechanism of deriving a new class from an old one i.e. objects of one class acquire the properties of objects of another class (reusability of code). 6. Polymorphism: It is the ability to take more than one form. 7. Dynamic Binding: It refers to any code that is called is not known until runtime. 8. Message passing: A set of objects that communicate with each other.
  • 7. User-Defined type Built-in type Derived type Structure Union Class Enumeration Array Function Pointer Reference Void Integral type Floating type Char(1) Int(2) & long int(4) Double(8) Float(4)
  • 8.  Assignment(=): Assign the values.  Mathematical(+,-,*,/,%): Mathematical operations.  Relational(< >,<=,>=,++,!=): Comparison.  Logical(&&,||): Combine 2 different expression.  Bitwise(&,|,^,~): Change individual bits into number.  Shift(<<,>>,>>>): Shift bits of any variable.  Unary(++,--): Used with one operand only.  Ternary(?:): Used with 3 operands.  Comma(,): Separation of variables and expressions.
  • 9.  In C++, the declaration of variable is allowed anywhere in the scope i.e. Variables can be declared right at the place of its use.  There are total 64 keywords in C++ given by ANSI. Scope of Variables All the variables have their area of functioning, and out of that boundary they don't hold their value, this boundary is called scope of the variable.  Global Variables  Local variables
  • 10.  Those variables which are once declared and can be used throughout the lifetime of the program by any class or any function.  They must be declared outside the main() function.  Those variables which exist only between the curly braces, in which its declared.  Outside that they are unavailable and leads to compile time error.
  • 13.  Class is a collection of objects of similar type.  Classes are user defined datatypes.  Once class is defined, then object is created & member fucntions are used.
  • 14. Sequence Selection Loop Action 1 Action 2 Action 3 Entry Exit Straight line Switch If--else While Do while For Condition Is Tested (True/False) Loops runs In it
  • 15. Action 1 Action 2 Action 3 Entry Exit Condition  If-else  Switch True False
  • 16. Action 1 Entry Exit Condition  Do-while  While  For True False Action 2 Loop
  • 17.
  • 18.
  • 19.  Kanetkar, P.Y. “Let Us C++” Seventh Edition 2007, pp. 34-37, BPB Publications, New Delhi-1.  Balaguruswamy, E. “Object Oriented Programming with C++” Eighth Edition 2016, pp. 14-40, Mc Graw Hill Education (India) Private Limited, New Delhi-110016.