SlideShare a Scribd company logo
Language
Elizabeth Pisarek, Cassie Baldus, & Dylan Eckstein
Basic knowledge of C++
● Developed by Bjarne Stroustrup
● It is an extension of the C language.
● Possible to code C++ in a "C style" or "object-
oriented style."
○ It can be coded in either way and is thus an
effective example of a hybrid language
● It is considered an intermediate-level language
★ C++ is a collection of predefined classes, which are
data types that can be instantiated multiple times
“Hello World” in C++
using namespace std;
#include <iostream>
// My first C++ program!
int main(void)
{
cout << "hello world!" <<
endl;
return 0;
}
Use the standard namespace
Include standard
iostream classes
A C++ comment
cout is an
instance of
ostream
operator overloading
(two different argument types!)
New Keywords
In addition the keywords inherited from C, C++ adds:
Exceptions catch, throw, try
Declarations:
bool, class, enum, explicit, export,
friend, inline, mutable, namespace,
operator, private, protected, public,
template, typename, using, virtual,
volatile, wchar_t
Expressions:
and, and_eq, bitand, bitor, compl,
const_cast, delete, dynamic_cast,
false, new, not, not_eq, or, or_eq,
reinterpret_cast, static_cast, this,
true, typeid, xor, xor_eq
Pointers in C++
int i;
int *iPtr; // a pointer to an integer
iPtr = &i; // iPtr contains the address of I
*iPtr = 100;
…
100
456FD4
456FD4
456FD0
i
iPtr
…
variable value Address in
hex
C++ Blocks
● Allow a section of code to have its own local vars
whose scope is minimized.
● Such vars are stack dynamic, so they have their
storage allocated when the section is entered and
deallocated when the section is exited
C++:
for (...)
{
int index;
...
}
6
C++ Binding
● Binding refers to the process that is to be used for
converting functions and variables into machine
language addresses.
● C++ supports two types:
1. Static/Early Binding
2. Dynamic/Late Binding
7
Static/Early Binding
● In static binding, there are similar function names that
are used in many places, their references and their
positions are indicated explicitly by the compiler.
● Their ambiguities are fixed at compile time.
8
Static/Early Binding Example
class first // base class
{
int d;
public:
void display() {------} // base class member function
};
class second : public first // derived class
{
int k;
public:
void display() {------} // member function of derived class
}
9
Dynamic/Late Binding
● In the case of a few programs, it is impossible to know
which function is to be called until run time. This is
called dynamic binding.
● Dynamic binding of member functions in C++ can be
done using the virtual keyword. The member function
followed by the keyword is called a virtual function.
10
Dynamic/Late Binding Example
class first // base class
{
int d;
public:
virtual void display() {------} // base class member function
};
class second : public first // derived class
{
int k;
public:
virtual void display() {------} // member function of derived
class
}
11
C++ Static Scoping
● C++ variables are always statically scoped
● Binding of a variable can be determined by program
text and is independent of the run-time function call
stack.
● C++ doesn't use Dynamic scoping.
12
C++ Type checking
● Type Checking: Determining if data types make sense
for the program and follow constraints
● Static Type Checking: Type checking is done when
the program is compiled
● Dynamic Type Checking: Type checking is done at
runtime
● C++ uses static type checking
13
C++ Run time environment
● There isn't a universal C++ runtime
system, but in the typical OS the
primary action of the C++ runtime is
to dynamically link shared libraries to
an executable.
14
15

More Related Content

PPTX
C vs c++
PDF
Differences between c and c++
PPTX
C and C ++ Training in Ambala ! BATRA COMPUTER CENTRE
PPTX
C vs c++
PDF
Large Scale JavaScript with TypeScript
PPTX
C++ basic
PPTX
Introduction to c programming language
PDF
Lecture 3 getting_started_with__c_
C vs c++
Differences between c and c++
C and C ++ Training in Ambala ! BATRA COMPUTER CENTRE
C vs c++
Large Scale JavaScript with TypeScript
C++ basic
Introduction to c programming language
Lecture 3 getting_started_with__c_

What's hot (20)

PPTX
difference between c c++ c#
PDF
Object Oriented Programming With Real-World Scenario
PPT
2. data, operators, io
DOCX
Virtual function
PPTX
Formalizing homogeneous language embeddings
PPT
C and C++ Industrial Training Jalandhar
PPTX
introduction to c programming language
PPTX
C language
PPT
C++ to java
PPTX
Theory of programming
PPTX
basics of c++
PPTX
Vitalii Braslavskyi "Declarative engineering"
PDF
Reduce course notes class xii
PPT
Why C is Called Structured Programming Language
PPTX
Mobile C++
PPTX
Multiple inheritance in c++
PPTX
Next .NET and C#
PDF
Hands-on Introduction to the C Programming Language
PDF
Scaling Language Specifications
PPT
C Lecture
difference between c c++ c#
Object Oriented Programming With Real-World Scenario
2. data, operators, io
Virtual function
Formalizing homogeneous language embeddings
C and C++ Industrial Training Jalandhar
introduction to c programming language
C language
C++ to java
Theory of programming
basics of c++
Vitalii Braslavskyi "Declarative engineering"
Reduce course notes class xii
Why C is Called Structured Programming Language
Mobile C++
Multiple inheritance in c++
Next .NET and C#
Hands-on Introduction to the C Programming Language
Scaling Language Specifications
C Lecture
Ad

Similar to C++ language (20)

PDF
C++primer
PDF
C++ Training
PPT
Oops lecture 1
PPTX
cbybalaguruswami-e-180803051831.pptx
PPTX
cbybalaguruswami-e-180803051831.pptx
PPTX
UNIT - 1- Ood ddnwkjfnewcsdkjnjkfnskfn.pptx
PPTX
CSharp presentation and software developement
PPTX
Switch case and looping
PPT
Synapseindia dot net development
PPT
PDF
C notes.pdf
PPTX
Introduction Of C++
PDF
88 c-programs
PDF
88 c programs 15184
PDF
88 c-programs
PDF
Functions And Header Files In C++ | Bjarne stroustrup
PPTX
OOC MODULE1.pptx
PPTX
C++ language
PPTX
C language updated
PPTX
Advantage and Disadvantages of C++ programming.pptx
C++primer
C++ Training
Oops lecture 1
cbybalaguruswami-e-180803051831.pptx
cbybalaguruswami-e-180803051831.pptx
UNIT - 1- Ood ddnwkjfnewcsdkjnjkfnskfn.pptx
CSharp presentation and software developement
Switch case and looping
Synapseindia dot net development
C notes.pdf
Introduction Of C++
88 c-programs
88 c programs 15184
88 c-programs
Functions And Header Files In C++ | Bjarne stroustrup
OOC MODULE1.pptx
C++ language
C language updated
Advantage and Disadvantages of C++ programming.pptx
Ad

More from Elizabeth Pisarek (16)

PPTX
A Day In The Life Of The Homeless In KC
DOCX
Working with JavaScript
DOCX
jQuery Code Testing
DOCX
Harley Davidson Flyer for AdInk
DOCX
Homepage for Website in 5 minutes
PDF
John Wick Movie Trailer & Poster Design
DOCX
ACM - Women flyer
DOCX
Personal website Project
PDF
Flyer Example
DOCX
Social media content
DOCX
Liking facebook page
PDF
JDTI Spec Sheet Design
PDF
User Experience Assignment
DOCX
Art Tech Website Design Layout
DOCX
Robot Research Paper
PDF
Popularity & Traffic Paper
A Day In The Life Of The Homeless In KC
Working with JavaScript
jQuery Code Testing
Harley Davidson Flyer for AdInk
Homepage for Website in 5 minutes
John Wick Movie Trailer & Poster Design
ACM - Women flyer
Personal website Project
Flyer Example
Social media content
Liking facebook page
JDTI Spec Sheet Design
User Experience Assignment
Art Tech Website Design Layout
Robot Research Paper
Popularity & Traffic Paper

Recently uploaded (20)

PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
TLE Review Electricity (Electricity).pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
A Presentation on Artificial Intelligence
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Getting Started with Data Integration: FME Form 101
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
Hybrid model detection and classification of lung cancer
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
TLE Review Electricity (Electricity).pptx
Group 1 Presentation -Planning and Decision Making .pptx
MIND Revenue Release Quarter 2 2025 Press Release
A comparative study of natural language inference in Swahili using monolingua...
A Presentation on Artificial Intelligence
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
cloud_computing_Infrastucture_as_cloud_p
Building Integrated photovoltaic BIPV_UPV.pdf
Univ-Connecticut-ChatGPT-Presentaion.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Programs and apps: productivity, graphics, security and other tools
Getting Started with Data Integration: FME Form 101
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Encapsulation_ Review paper, used for researhc scholars
Zenith AI: Advanced Artificial Intelligence
Hybrid model detection and classification of lung cancer
Agricultural_Statistics_at_a_Glance_2022_0.pdf
A comparative analysis of optical character recognition models for extracting...
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf

C++ language

  • 1. Language Elizabeth Pisarek, Cassie Baldus, & Dylan Eckstein
  • 2. Basic knowledge of C++ ● Developed by Bjarne Stroustrup ● It is an extension of the C language. ● Possible to code C++ in a "C style" or "object- oriented style." ○ It can be coded in either way and is thus an effective example of a hybrid language ● It is considered an intermediate-level language ★ C++ is a collection of predefined classes, which are data types that can be instantiated multiple times
  • 3. “Hello World” in C++ using namespace std; #include <iostream> // My first C++ program! int main(void) { cout << "hello world!" << endl; return 0; } Use the standard namespace Include standard iostream classes A C++ comment cout is an instance of ostream operator overloading (two different argument types!)
  • 4. New Keywords In addition the keywords inherited from C, C++ adds: Exceptions catch, throw, try Declarations: bool, class, enum, explicit, export, friend, inline, mutable, namespace, operator, private, protected, public, template, typename, using, virtual, volatile, wchar_t Expressions: and, and_eq, bitand, bitor, compl, const_cast, delete, dynamic_cast, false, new, not, not_eq, or, or_eq, reinterpret_cast, static_cast, this, true, typeid, xor, xor_eq
  • 5. Pointers in C++ int i; int *iPtr; // a pointer to an integer iPtr = &i; // iPtr contains the address of I *iPtr = 100; … 100 456FD4 456FD4 456FD0 i iPtr … variable value Address in hex
  • 6. C++ Blocks ● Allow a section of code to have its own local vars whose scope is minimized. ● Such vars are stack dynamic, so they have their storage allocated when the section is entered and deallocated when the section is exited C++: for (...) { int index; ... } 6
  • 7. C++ Binding ● Binding refers to the process that is to be used for converting functions and variables into machine language addresses. ● C++ supports two types: 1. Static/Early Binding 2. Dynamic/Late Binding 7
  • 8. Static/Early Binding ● In static binding, there are similar function names that are used in many places, their references and their positions are indicated explicitly by the compiler. ● Their ambiguities are fixed at compile time. 8
  • 9. Static/Early Binding Example class first // base class { int d; public: void display() {------} // base class member function }; class second : public first // derived class { int k; public: void display() {------} // member function of derived class } 9
  • 10. Dynamic/Late Binding ● In the case of a few programs, it is impossible to know which function is to be called until run time. This is called dynamic binding. ● Dynamic binding of member functions in C++ can be done using the virtual keyword. The member function followed by the keyword is called a virtual function. 10
  • 11. Dynamic/Late Binding Example class first // base class { int d; public: virtual void display() {------} // base class member function }; class second : public first // derived class { int k; public: virtual void display() {------} // member function of derived class } 11
  • 12. C++ Static Scoping ● C++ variables are always statically scoped ● Binding of a variable can be determined by program text and is independent of the run-time function call stack. ● C++ doesn't use Dynamic scoping. 12
  • 13. C++ Type checking ● Type Checking: Determining if data types make sense for the program and follow constraints ● Static Type Checking: Type checking is done when the program is compiled ● Dynamic Type Checking: Type checking is done at runtime ● C++ uses static type checking 13
  • 14. C++ Run time environment ● There isn't a universal C++ runtime system, but in the typical OS the primary action of the C++ runtime is to dynamically link shared libraries to an executable. 14
  • 15. 15