SlideShare a Scribd company logo
Sayed Ahmed
Just E.T.C Technologies Inc.
Just E.T.C. Education Inc.
 C++ is based on and an extension to C
 Knowing similarities and dissimilarities between C
and C++ will help
 to select the right language for your application
development
 Comments:
 Header File: #include <iostream>
 Namespace: A defined collection of symbols and
variable names within an application
 The main () function: must have in a program
 Parentheses: A function/code block name is followed
by Parentheses ()
 Braces: Boundary of code blocks
 Variables: Used to contain values. Think about
variables in Mathematics
 Statements: An instruction to the computer hardware
to perform specific action.
 Statement Terminator: a semicolon
 Function calls:
 One function can call another function.
 It's just a transfer of control from one code block to
another code block.
 However, the control comes back to the caller again.
 #include <iostream>
 using namespace std;
 int main() {
 int studentId;
 count << "what is your student ID" << endl;
 cin>> studentId;
 count << "Student Id " << studentId << endl;
 }
 A C++ program must have a namespace;
 C program ends with .c
 where C++ program ends with .cpp
 Information communication to and from c program is
treated as stream.
 cout and cin are used for the purpose
 cout and cin are practically objects
 To store values
 case sensitive
 must start with letter
 Supportted datatypes: char, int, float, double, boolean,
wchar_t
 float: usually 32 bits - 6 digit after decimam,
 double: 64 bits - 10 digit after decimal,
 Can be declared anywhere
 Local:
 inside functions
 Static:
 Inside functions but do not get destroyed after
 Global:
 Declared outside the functions
 can be accessed from anywhere in the program
 Formal/Parameter
 Hidden variable:
 if a local variable use the same name of a global variable the local
variable = hidden variable
 use scope operator :: to access the global variable inside that
function
 Group of variable
 A group of variables of the same type
 in c strings are null terminated arrays
 C++ also supports a predefined string class/data type;
 include <string>
 in c, define XYZ 100
 in c++, const int val=1000
 Enables Code Resuse
 Enables Data Security from Unauthorized Access
 Object:
 Attribute + behaviors
 Primary OOP Concepts
 Encapsulation:
 Inheritance:
 - reduce development time
 - reuse
 -increase maintainability of the code
 Polymorphism:
 assign different uses to an entity based onthe context
 Abstraction:
 simple representation of an objet.
 hide not essential attributes and behaviors
 Object Oriented Paradigm:
 Define objects - toughest
 define messages
 define properties
 --define attributes
 --define behaviors
 Object behavior analysis:
 Understand the application
 Derive Objects
 Categorize Objects
 Model process flow
 C++ Compliers Must Support: ANSI Standard
 Internationalization
 Template
 Locales
 Namespaces
 Friend Class
 Friend functions and inline functions provide faster, and
efficient application
 A function can be friend to any number of functions
 Use function declaration to declare friend functions
 Static Data Members and Static Members
 Function - create the common members of classes
(across objects)
 Constructor
 no return types
 called at object creation
 Destructor
 no return type
 Operator Overloading
 Compile time polymorphism
 runtime poly
 - inheritance
 virtual functions
 Operator Overloading:
 -unary
 -binary
 -arithmetic
 -assignment
 Note: C++ does not support overloading based on return
type
 Early Binding/Late Binding
 Access Modifiers absent = protected
 inheritance and destructors
 Diamond Problem: Virtual Base Class
 Overriding
 Pure Virtual Function
 manipulators
 COUT, setw, right, setfill, flush, endl
 fstreambase
 fstream
 ifstream
 ofstream
 Mode of file opening
 ios::in
 ios::out
 Sscanf
 Read formatted file data
 ifstream
 fin.getLine()
 Random File Reading
 seekg
 seekp
 I/O System
 Buffered file system
 Stream classes
 stream
 istream--_IO_istream_withassign
 ostream
 Iostream
 Cin is an instance of _IO_istream_withassign
 Instance of _IO_ostream_withassign
 cout
 cerr
 Stream formatting flags
 Can be used with setf(), unsetf()
 ios::left
 ios::dec
 ios::fixed
 ios::oct
 ios::right
 ios::scientific
 ios::showbase
 ios::showpoint
 ios::showpos
 ios::uppercase
 Unformatted input/output
 character
 character array
 strings
 use text buffer
 Can provide abstraction of the I/O device
 functions for unformatted input and output
 cin.read()
 cin.gcount()
 cout.write()
 Files
 fstreambase
 opening, manipulating, closing
 fstream, ifstream, ofstream
 mode ios::app, ios::ate, ios::binary, ios::in, ios::out, ios::trunc
 fin.getline()
 Get pointers
 Random Operation Put pointers
 pointers
 Seekg()
 Seekp()
 Tellg()
 Tellp()
 Handling Exceptions
 runtime errors
 Exceptions
 try and catch block
 throw statement
 Uncaught Exceptions
 Multiple Catch
 ----------
 identified by operating systems
 if not handled passed to op system exception as int, char ,class strings
 how it passes through functions
 Derived Class Exceptions
 catch block hierarchy
 place derived classes catch up
 runtime with virtual functions
 shape
 -draw
 rect
 tri
 define overriding by placing function in each
 Show why virtual function needed?
 virtual base
 pointer runtime polymorphism
 pure virtual function
 Late binding
 base point to base - call derive function - runtime-dynamic
 Templates create reusable code
 STL provides some foundational items
 --templatized functions and
 --classes
 These can be used to solve a variety of problems
 Some STL Elements
 Containers
 Algorithms
 Iterators
 STLs are compatible across operating systems
 Containers
 Vectors
 Lists
 Maps
 Containers
 Sequence
 Associative
 Algorithms
 function templates work with container templates of any type
 algorithm header file
 Iterators are objects to cycle through the containers
 iterator header file needs to be included if iterators are used
 Iterator type:
 Random Access
 Bidirectional
 Forward
 Input
 Output
 Vector and Array Comparison
 container - behave the same way - infinite
 Lists: class
 Bidirectional linear sequentially
 Functions
 begin()
 end()
 erase()
 insert(); (template)
 push_back();
 push_front();
 remove();
 splice();
 Associative Container
 Map templates take two parameters
 Functions:
 begin();
 clear();
 count();
 empty();
 end();
 erase();
 insert();
 size()
 Working with Templates
 Imagine a situation - complex + many data type
 Overload may help but time consuming
 template can help
 object creation define data type
 template overloading

More Related Content

What's hot (20)

PDF
C++ version 1
JIGAR MAKHIJA
 
PDF
Understanding C# in .NET
mentorrbuddy
 
PPTX
Tokens expressionsin C++
HalaiHansaika
 
PPT
Taking User Input in Java
Eftakhairul Islam
 
PPTX
Buffer and scanner
Arif Ullah
 
PPTX
Java 8 lambda
Manav Prasad
 
PPT
ppt on scanner class
deepsxn
 
PPT
Input and output in C++
Nilesh Dalvi
 
PPTX
Presentation 1st
Connex
 
PPT
Templates exception handling
sanya6900
 
PPTX
Java input
Jin Castor
 
PDF
Lambda Expressions in Java
Erhan Bagdemir
 
PPT
Scala
Zhiwen Guo
 
PPTX
Java8: what's new and what's hot
Sergii Maliarov
 
DOCX
Java scanner, everything you need to know about Java Scanner
Edward Nyang'ali
 
PPTX
Java vs kotlin
Deesha Vora
 
PDF
Python Programming - VII. Customizing Classes and Operator Overloading
Ranel Padon
 
PDF
Function overloading ppt
Prof. Dr. K. Adisesha
 
PPTX
Files io
Narayana Swamy
 
PDF
Java8
Felipe Mamud
 
C++ version 1
JIGAR MAKHIJA
 
Understanding C# in .NET
mentorrbuddy
 
Tokens expressionsin C++
HalaiHansaika
 
Taking User Input in Java
Eftakhairul Islam
 
Buffer and scanner
Arif Ullah
 
Java 8 lambda
Manav Prasad
 
ppt on scanner class
deepsxn
 
Input and output in C++
Nilesh Dalvi
 
Presentation 1st
Connex
 
Templates exception handling
sanya6900
 
Java input
Jin Castor
 
Lambda Expressions in Java
Erhan Bagdemir
 
Scala
Zhiwen Guo
 
Java8: what's new and what's hot
Sergii Maliarov
 
Java scanner, everything you need to know about Java Scanner
Edward Nyang'ali
 
Java vs kotlin
Deesha Vora
 
Python Programming - VII. Customizing Classes and Operator Overloading
Ranel Padon
 
Function overloading ppt
Prof. Dr. K. Adisesha
 
Files io
Narayana Swamy
 

Similar to Introduction to c_plus_plus (6) (20)

PPT
C++ tutorials
Divyanshu Dubey
 
PPTX
C++ process new
敬倫 林
 
PPTX
C++ theory
Shyam Khant
 
PPTX
C++ language
Hamza Asif
 
PPTX
Introduction to c ++ part -1
baabtra.com - No. 1 supplier of quality freshers
 
PPTX
UNIT - 1- Ood ddnwkjfnewcsdkjnjkfnskfn.pptx
crazysamarth927
 
PPTX
Learn c++ Programming Language
Steve Johnson
 
PPT
Oops lecture 1
rehan16091997
 
PPTX
Presentation on C++ Programming Language
satvirsandhu9
 
PPTX
Introduction to C++ Programming
Preeti Kashyap
 
PPTX
C++ lectures all chapters in one slide.pptx
ssuser3cbb4c
 
PPTX
OOC MODULE1.pptx
1HK19CS090MOHAMMEDSA
 
PDF
Mastering Modern C++: C++11, C++14, C++17, C++20, C++23
Massimo Talia
 
PPTX
object oriented programming language in c++
Ravikant517175
 
PDF
C++primer
leonlongli
 
PPT
lecture02-cpp.ppt
DevliNeeraj
 
PPT
lecture02-cpp.ppt
ssuser0c24d5
 
PPT
lecture02-cpp.ppt
nilesh405711
 
PPT
lecture02-cpp.ppt
YashpalYadav46
 
PPTX
Unit 1
donny101
 
C++ tutorials
Divyanshu Dubey
 
C++ process new
敬倫 林
 
C++ theory
Shyam Khant
 
C++ language
Hamza Asif
 
UNIT - 1- Ood ddnwkjfnewcsdkjnjkfnskfn.pptx
crazysamarth927
 
Learn c++ Programming Language
Steve Johnson
 
Oops lecture 1
rehan16091997
 
Presentation on C++ Programming Language
satvirsandhu9
 
Introduction to C++ Programming
Preeti Kashyap
 
C++ lectures all chapters in one slide.pptx
ssuser3cbb4c
 
OOC MODULE1.pptx
1HK19CS090MOHAMMEDSA
 
Mastering Modern C++: C++11, C++14, C++17, C++20, C++23
Massimo Talia
 
object oriented programming language in c++
Ravikant517175
 
C++primer
leonlongli
 
lecture02-cpp.ppt
DevliNeeraj
 
lecture02-cpp.ppt
ssuser0c24d5
 
lecture02-cpp.ppt
nilesh405711
 
lecture02-cpp.ppt
YashpalYadav46
 
Unit 1
donny101
 
Ad

More from Sayed Ahmed (20)

PDF
Workplace, Data Analytics, and Ethics
Sayed Ahmed
 
PPTX
Python py charm anaconda jupyter installation and basic commands
Sayed Ahmed
 
PPTX
[not edited] Demo on mobile app development using ionic framework
Sayed Ahmed
 
PPTX
Sap hana-ide-overview-nodev
Sayed Ahmed
 
PPTX
Invest wisely
Sayed Ahmed
 
PPTX
Will be an introduction to
Sayed Ahmed
 
PPTX
Whm and cpanel overview hosting control panel overview
Sayed Ahmed
 
PPTX
Web application development using zend framework
Sayed Ahmed
 
PPTX
Web design and_html_part_3
Sayed Ahmed
 
PPTX
Web design and_html_part_2
Sayed Ahmed
 
PPTX
Web design and_html
Sayed Ahmed
 
PPTX
Visual studio ide shortcuts
Sayed Ahmed
 
PPTX
Virtualization
Sayed Ahmed
 
PPT
User interfaces
Sayed Ahmed
 
PPT
Unreal
Sayed Ahmed
 
PPTX
Unit tests in_symfony
Sayed Ahmed
 
PPTX
Telerik this is sayed
Sayed Ahmed
 
PPTX
System analysis and_design
Sayed Ahmed
 
PPTX
Symfony 2
Sayed Ahmed
 
PPT
Story telling and_narrative
Sayed Ahmed
 
Workplace, Data Analytics, and Ethics
Sayed Ahmed
 
Python py charm anaconda jupyter installation and basic commands
Sayed Ahmed
 
[not edited] Demo on mobile app development using ionic framework
Sayed Ahmed
 
Sap hana-ide-overview-nodev
Sayed Ahmed
 
Invest wisely
Sayed Ahmed
 
Will be an introduction to
Sayed Ahmed
 
Whm and cpanel overview hosting control panel overview
Sayed Ahmed
 
Web application development using zend framework
Sayed Ahmed
 
Web design and_html_part_3
Sayed Ahmed
 
Web design and_html_part_2
Sayed Ahmed
 
Web design and_html
Sayed Ahmed
 
Visual studio ide shortcuts
Sayed Ahmed
 
Virtualization
Sayed Ahmed
 
User interfaces
Sayed Ahmed
 
Unreal
Sayed Ahmed
 
Unit tests in_symfony
Sayed Ahmed
 
Telerik this is sayed
Sayed Ahmed
 
System analysis and_design
Sayed Ahmed
 
Symfony 2
Sayed Ahmed
 
Story telling and_narrative
Sayed Ahmed
 
Ad

Recently uploaded (20)

PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 

Introduction to c_plus_plus (6)

  • 1. Sayed Ahmed Just E.T.C Technologies Inc. Just E.T.C. Education Inc.
  • 2.  C++ is based on and an extension to C  Knowing similarities and dissimilarities between C and C++ will help  to select the right language for your application development
  • 3.  Comments:  Header File: #include <iostream>  Namespace: A defined collection of symbols and variable names within an application  The main () function: must have in a program  Parentheses: A function/code block name is followed by Parentheses ()  Braces: Boundary of code blocks
  • 4.  Variables: Used to contain values. Think about variables in Mathematics  Statements: An instruction to the computer hardware to perform specific action.  Statement Terminator: a semicolon  Function calls:  One function can call another function.  It's just a transfer of control from one code block to another code block.  However, the control comes back to the caller again.
  • 5.  #include <iostream>  using namespace std;  int main() {  int studentId;  count << "what is your student ID" << endl;  cin>> studentId;  count << "Student Id " << studentId << endl;  }
  • 6.  A C++ program must have a namespace;  C program ends with .c  where C++ program ends with .cpp  Information communication to and from c program is treated as stream.  cout and cin are used for the purpose  cout and cin are practically objects
  • 7.  To store values  case sensitive  must start with letter  Supportted datatypes: char, int, float, double, boolean, wchar_t  float: usually 32 bits - 6 digit after decimam,  double: 64 bits - 10 digit after decimal,
  • 8.  Can be declared anywhere  Local:  inside functions  Static:  Inside functions but do not get destroyed after  Global:  Declared outside the functions  can be accessed from anywhere in the program  Formal/Parameter  Hidden variable:  if a local variable use the same name of a global variable the local variable = hidden variable  use scope operator :: to access the global variable inside that function
  • 9.  Group of variable  A group of variables of the same type  in c strings are null terminated arrays  C++ also supports a predefined string class/data type;  include <string>
  • 10.  in c, define XYZ 100  in c++, const int val=1000
  • 11.  Enables Code Resuse  Enables Data Security from Unauthorized Access  Object:  Attribute + behaviors  Primary OOP Concepts  Encapsulation:  Inheritance:  - reduce development time  - reuse  -increase maintainability of the code  Polymorphism:  assign different uses to an entity based onthe context  Abstraction:  simple representation of an objet.  hide not essential attributes and behaviors
  • 12.  Object Oriented Paradigm:  Define objects - toughest  define messages  define properties  --define attributes  --define behaviors  Object behavior analysis:  Understand the application  Derive Objects  Categorize Objects  Model process flow
  • 13.  C++ Compliers Must Support: ANSI Standard  Internationalization  Template  Locales  Namespaces
  • 14.  Friend Class  Friend functions and inline functions provide faster, and efficient application  A function can be friend to any number of functions  Use function declaration to declare friend functions  Static Data Members and Static Members  Function - create the common members of classes (across objects)
  • 15.  Constructor  no return types  called at object creation  Destructor  no return type
  • 16.  Operator Overloading  Compile time polymorphism  runtime poly  - inheritance  virtual functions  Operator Overloading:  -unary  -binary  -arithmetic  -assignment  Note: C++ does not support overloading based on return type
  • 17.  Early Binding/Late Binding  Access Modifiers absent = protected
  • 18.  inheritance and destructors  Diamond Problem: Virtual Base Class  Overriding  Pure Virtual Function
  • 19.  manipulators  COUT, setw, right, setfill, flush, endl  fstreambase  fstream  ifstream  ofstream
  • 20.  Mode of file opening  ios::in  ios::out  Sscanf  Read formatted file data  ifstream  fin.getLine()  Random File Reading  seekg  seekp
  • 21.  I/O System  Buffered file system  Stream classes  stream  istream--_IO_istream_withassign  ostream  Iostream  Cin is an instance of _IO_istream_withassign  Instance of _IO_ostream_withassign  cout  cerr
  • 22.  Stream formatting flags  Can be used with setf(), unsetf()  ios::left  ios::dec  ios::fixed  ios::oct  ios::right  ios::scientific  ios::showbase  ios::showpoint  ios::showpos  ios::uppercase
  • 23.  Unformatted input/output  character  character array  strings  use text buffer  Can provide abstraction of the I/O device  functions for unformatted input and output  cin.read()  cin.gcount()  cout.write()
  • 24.  Files  fstreambase  opening, manipulating, closing  fstream, ifstream, ofstream  mode ios::app, ios::ate, ios::binary, ios::in, ios::out, ios::trunc  fin.getline()  Get pointers  Random Operation Put pointers  pointers  Seekg()  Seekp()  Tellg()  Tellp()
  • 25.  Handling Exceptions  runtime errors  Exceptions  try and catch block  throw statement  Uncaught Exceptions  Multiple Catch  ----------  identified by operating systems  if not handled passed to op system exception as int, char ,class strings  how it passes through functions  Derived Class Exceptions  catch block hierarchy  place derived classes catch up
  • 26.  runtime with virtual functions  shape  -draw  rect  tri  define overriding by placing function in each  Show why virtual function needed?  virtual base  pointer runtime polymorphism  pure virtual function  Late binding  base point to base - call derive function - runtime-dynamic
  • 27.  Templates create reusable code  STL provides some foundational items  --templatized functions and  --classes  These can be used to solve a variety of problems  Some STL Elements  Containers  Algorithms  Iterators  STLs are compatible across operating systems
  • 28.  Containers  Vectors  Lists  Maps  Containers  Sequence  Associative
  • 29.  Algorithms  function templates work with container templates of any type  algorithm header file  Iterators are objects to cycle through the containers  iterator header file needs to be included if iterators are used  Iterator type:  Random Access  Bidirectional  Forward  Input  Output
  • 30.  Vector and Array Comparison  container - behave the same way - infinite
  • 31.  Lists: class  Bidirectional linear sequentially  Functions  begin()  end()  erase()  insert(); (template)  push_back();  push_front();  remove();  splice();
  • 32.  Associative Container  Map templates take two parameters  Functions:  begin();  clear();  count();  empty();  end();  erase();  insert();  size()
  • 33.  Working with Templates  Imagine a situation - complex + many data type  Overload may help but time consuming  template can help  object creation define data type  template overloading