SlideShare a Scribd company logo
1 of 19
Basic Concepts of OOPs Lecture 2 Object Oriented Programming with C++
A typical C++ program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Basics of C++ - data types ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Basics of C++ - variables ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Basics of C++ - operators ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Basics of C++ - operators ,[object Object],[object Object],[object Object],[object Object],[object Object]
Basics of C++ - functions int someFunction(double f, char c)  {   // … }   Name Body Parameter List Return Type Name Parameter List Body Name Parameter List Return Type Body Name Parameter List Return Type
Basics of C++ - functions ,[object Object],[object Object],[object Object],[object Object],[object Object]
Basics of C++ - functions ,[object Object],[object Object],[object Object],[object Object],The parameter v is not copied.
Basics of C++: I/O ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Basics of C++ - arrays ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Basics of C++ - pointer ,[object Object],[object Object],[object Object],[object Object]
Basics of C++ - pointer ,[object Object],[object Object],[object Object],[object Object],[object Object],The * operator accesses the data on the memory address The * operator accesses the data on the memory address ,[object Object],pointer arithmetic
Control Structures - Decisions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Control Structures - Decisions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Control Structures - Iteration ,[object Object],[object Object],[object Object],[object Object],[object Object],Start condition Action taking place at the end of each iteration Terminating condition
Control Structures - Iteration ,[object Object],[object Object],[object Object],[object Object],Equivalent to:  for( ; condition ; ) {  // do something }
Control structures -    do … while ,[object Object],[object Object],[object Object],[object Object],Equivalent to: // something while( condition) {  // something }
Control Structures ,[object Object],[object Object]

More Related Content

What's hot

Few Operator used in c++
Few Operator used in c++Few Operator used in c++
Few Operator used in c++sunny khan
 
Mathematics Function in C ,ppt
Mathematics Function in C ,pptMathematics Function in C ,ppt
Mathematics Function in C ,pptAllNewTeach
 
C Programming Language Part 7
C Programming Language Part 7C Programming Language Part 7
C Programming Language Part 7Rumman Ansari
 
C programming pointer
C  programming pointerC  programming pointer
C programming pointerargusacademy
 
C programming Lab 2
C programming Lab 2C programming Lab 2
C programming Lab 2Zaibi Gondal
 
Introduction to Computer and Programing - Lecture 04
Introduction to Computer and Programing - Lecture 04Introduction to Computer and Programing - Lecture 04
Introduction to Computer and Programing - Lecture 04hassaanciit
 
c++ exp 1 Suraj...pdf
c++ exp 1 Suraj...pdfc++ exp 1 Suraj...pdf
c++ exp 1 Suraj...pdfayush616992
 
Concepts of C [Module 2]
Concepts of C [Module 2]Concepts of C [Module 2]
Concepts of C [Module 2]Abhishek Sinha
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd StudyChris Ohk
 
C Programming Language Step by Step Part 2
C Programming Language Step by Step Part 2C Programming Language Step by Step Part 2
C Programming Language Step by Step Part 2Rumman Ansari
 
please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...hwbloom27
 
Increment and Decrement operators in C++
Increment and Decrement operators in C++Increment and Decrement operators in C++
Increment and Decrement operators in C++Neeru Mittal
 
Infix to Prefix (Conversion, Evaluation, Code)
Infix to Prefix (Conversion, Evaluation, Code)Infix to Prefix (Conversion, Evaluation, Code)
Infix to Prefix (Conversion, Evaluation, Code)Ahmed Khateeb
 
Lab 10 sem ii_12_13
Lab 10 sem ii_12_13Lab 10 sem ii_12_13
Lab 10 sem ii_12_13alish sha
 
C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th StudyChris Ohk
 
Core programming in c
Core programming in cCore programming in c
Core programming in cRahul Pandit
 
C Programming Language Part 6
C Programming Language Part 6C Programming Language Part 6
C Programming Language Part 6Rumman Ansari
 
Lab 9 sem ii_12_13
Lab 9 sem ii_12_13Lab 9 sem ii_12_13
Lab 9 sem ii_12_13alish sha
 

What's hot (20)

Few Operator used in c++
Few Operator used in c++Few Operator used in c++
Few Operator used in c++
 
Mathematics Function in C ,ppt
Mathematics Function in C ,pptMathematics Function in C ,ppt
Mathematics Function in C ,ppt
 
C Programming Language Part 7
C Programming Language Part 7C Programming Language Part 7
C Programming Language Part 7
 
First c program
First c programFirst c program
First c program
 
C programming pointer
C  programming pointerC  programming pointer
C programming pointer
 
C programming Lab 2
C programming Lab 2C programming Lab 2
C programming Lab 2
 
Introduction to Computer and Programing - Lecture 04
Introduction to Computer and Programing - Lecture 04Introduction to Computer and Programing - Lecture 04
Introduction to Computer and Programing - Lecture 04
 
c++ exp 1 Suraj...pdf
c++ exp 1 Suraj...pdfc++ exp 1 Suraj...pdf
c++ exp 1 Suraj...pdf
 
Concepts of C [Module 2]
Concepts of C [Module 2]Concepts of C [Module 2]
Concepts of C [Module 2]
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd Study
 
C Programming Language Step by Step Part 2
C Programming Language Step by Step Part 2C Programming Language Step by Step Part 2
C Programming Language Step by Step Part 2
 
please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...
 
Increment and Decrement operators in C++
Increment and Decrement operators in C++Increment and Decrement operators in C++
Increment and Decrement operators in C++
 
Infix to Prefix (Conversion, Evaluation, Code)
Infix to Prefix (Conversion, Evaluation, Code)Infix to Prefix (Conversion, Evaluation, Code)
Infix to Prefix (Conversion, Evaluation, Code)
 
Lab 10 sem ii_12_13
Lab 10 sem ii_12_13Lab 10 sem ii_12_13
Lab 10 sem ii_12_13
 
C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th Study
 
Core programming in c
Core programming in cCore programming in c
Core programming in c
 
Practical no 3
Practical no 3Practical no 3
Practical no 3
 
C Programming Language Part 6
C Programming Language Part 6C Programming Language Part 6
C Programming Language Part 6
 
Lab 9 sem ii_12_13
Lab 9 sem ii_12_13Lab 9 sem ii_12_13
Lab 9 sem ii_12_13
 

Viewers also liked

Lecture 02 terminology of database
Lecture 02 terminology of  databaseLecture 02 terminology of  database
Lecture 02 terminology of databaseemailharmeet
 
Lecture 09 dblc centralized vs decentralized design
Lecture 09   dblc centralized vs decentralized designLecture 09   dblc centralized vs decentralized design
Lecture 09 dblc centralized vs decentralized designemailharmeet
 
Lecture 08 distributed dbms
Lecture 08 distributed dbmsLecture 08 distributed dbms
Lecture 08 distributed dbmsemailharmeet
 
Lecture 06 relational algebra and calculus
Lecture 06 relational algebra and calculusLecture 06 relational algebra and calculus
Lecture 06 relational algebra and calculusemailharmeet
 
Lecture 03 data abstraction and er model
Lecture 03 data abstraction and er modelLecture 03 data abstraction and er model
Lecture 03 data abstraction and er modelemailharmeet
 
Lecture 09 dblc centralized vs decentralized design
Lecture 09   dblc centralized vs decentralized designLecture 09   dblc centralized vs decentralized design
Lecture 09 dblc centralized vs decentralized designemailharmeet
 
Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization emailharmeet
 
Lecture 10 distributed database management system
Lecture 10   distributed database management systemLecture 10   distributed database management system
Lecture 10 distributed database management systememailharmeet
 
Lecture 01 introduction to database
Lecture 01 introduction to databaseLecture 01 introduction to database
Lecture 01 introduction to databaseemailharmeet
 
The Member--Centric Association Configuring Your Organization for Membership...
The Member--Centric Association Configuring Your Organization  for Membership...The Member--Centric Association Configuring Your Organization  for Membership...
The Member--Centric Association Configuring Your Organization for Membership...McKinley Advisors
 
Assignment#4 gorosito
Assignment#4 gorositoAssignment#4 gorosito
Assignment#4 gorositoAnnyaM
 
OSS Bar Camp - The growing usage of Open Source desktop client SW in IBM
OSS Bar Camp - The growing usage of Open Source desktop client SW in IBM OSS Bar Camp - The growing usage of Open Source desktop client SW in IBM
OSS Bar Camp - The growing usage of Open Source desktop client SW in IBM Brian O'Donovan
 
Writing vs volleyball
Writing vs volleyballWriting vs volleyball
Writing vs volleyballISB
 
fsb benefits pres
fsb benefits presfsb benefits pres
fsb benefits presalancole99
 

Viewers also liked (20)

Lecture 02 terminology of database
Lecture 02 terminology of  databaseLecture 02 terminology of  database
Lecture 02 terminology of database
 
Lecture 09 dblc centralized vs decentralized design
Lecture 09   dblc centralized vs decentralized designLecture 09   dblc centralized vs decentralized design
Lecture 09 dblc centralized vs decentralized design
 
Lecture 05 dblc
Lecture 05 dblcLecture 05 dblc
Lecture 05 dblc
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Lecture 08 distributed dbms
Lecture 08 distributed dbmsLecture 08 distributed dbms
Lecture 08 distributed dbms
 
Lecture 06 relational algebra and calculus
Lecture 06 relational algebra and calculusLecture 06 relational algebra and calculus
Lecture 06 relational algebra and calculus
 
Lecture 03 data abstraction and er model
Lecture 03 data abstraction and er modelLecture 03 data abstraction and er model
Lecture 03 data abstraction and er model
 
Lecture 09 dblc centralized vs decentralized design
Lecture 09   dblc centralized vs decentralized designLecture 09   dblc centralized vs decentralized design
Lecture 09 dblc centralized vs decentralized design
 
Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization
 
Lecture 10 distributed database management system
Lecture 10   distributed database management systemLecture 10   distributed database management system
Lecture 10 distributed database management system
 
Lecture 01 introduction to database
Lecture 01 introduction to databaseLecture 01 introduction to database
Lecture 01 introduction to database
 
Ib(i)
Ib(i)Ib(i)
Ib(i)
 
Tecnologigal invents
Tecnologigal inventsTecnologigal invents
Tecnologigal invents
 
Golf journal 2016_web
Golf journal 2016_webGolf journal 2016_web
Golf journal 2016_web
 
The Member--Centric Association Configuring Your Organization for Membership...
The Member--Centric Association Configuring Your Organization  for Membership...The Member--Centric Association Configuring Your Organization  for Membership...
The Member--Centric Association Configuring Your Organization for Membership...
 
Testing for greatness
Testing for greatnessTesting for greatness
Testing for greatness
 
Assignment#4 gorosito
Assignment#4 gorositoAssignment#4 gorosito
Assignment#4 gorosito
 
OSS Bar Camp - The growing usage of Open Source desktop client SW in IBM
OSS Bar Camp - The growing usage of Open Source desktop client SW in IBM OSS Bar Camp - The growing usage of Open Source desktop client SW in IBM
OSS Bar Camp - The growing usage of Open Source desktop client SW in IBM
 
Writing vs volleyball
Writing vs volleyballWriting vs volleyball
Writing vs volleyball
 
fsb benefits pres
fsb benefits presfsb benefits pres
fsb benefits pres
 

Similar to Lecture 3 c++ (20)

Pointer
PointerPointer
Pointer
 
C++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxC++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptx
 
CPP Language Basics - Reference
CPP Language Basics - ReferenceCPP Language Basics - Reference
CPP Language Basics - Reference
 
An imperative study of c
An imperative study of cAn imperative study of c
An imperative study of c
 
C++ Functions.ppt
C++ Functions.pptC++ Functions.ppt
C++ Functions.ppt
 
C++ Function
C++ FunctionC++ Function
C++ Function
 
CP 04.pptx
CP 04.pptxCP 04.pptx
CP 04.pptx
 
Code optimization
Code optimization Code optimization
Code optimization
 
Code optimization
Code optimization Code optimization
Code optimization
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Language
 
Cplusplus
CplusplusCplusplus
Cplusplus
 
PostThis
PostThisPostThis
PostThis
 
Lập trình C
Lập trình CLập trình C
Lập trình C
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to c
 
Assignment c programming
Assignment c programmingAssignment c programming
Assignment c programming
 
Pointers+(2)
Pointers+(2)Pointers+(2)
Pointers+(2)
 
Lecture5
Lecture5Lecture5
Lecture5
 
C programming
C programmingC programming
C programming
 
Bca 2nd sem u-4 operator overloading
Bca 2nd sem u-4 operator overloadingBca 2nd sem u-4 operator overloading
Bca 2nd sem u-4 operator overloading
 
operator overloading
operator overloadingoperator overloading
operator overloading
 

More from emailharmeet

Lecture 07 relational database management system
Lecture 07 relational database management systemLecture 07 relational database management system
Lecture 07 relational database management systememailharmeet
 
Lecture 00 introduction to course
Lecture 00 introduction to courseLecture 00 introduction to course
Lecture 00 introduction to courseemailharmeet
 
Syllabus mca 2 rdbms i
Syllabus mca 2 rdbms iSyllabus mca 2 rdbms i
Syllabus mca 2 rdbms iemailharmeet
 

More from emailharmeet (7)

Lecture 07 relational database management system
Lecture 07 relational database management systemLecture 07 relational database management system
Lecture 07 relational database management system
 
Revision Lecture
Revision LectureRevision Lecture
Revision Lecture
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
Course File c++
Course File c++Course File c++
Course File c++
 
Assignmnet 1
Assignmnet 1Assignmnet 1
Assignmnet 1
 
Lecture 00 introduction to course
Lecture 00 introduction to courseLecture 00 introduction to course
Lecture 00 introduction to course
 
Syllabus mca 2 rdbms i
Syllabus mca 2 rdbms iSyllabus mca 2 rdbms i
Syllabus mca 2 rdbms i
 

Lecture 3 c++

  • 1. Basic Concepts of OOPs Lecture 2 Object Oriented Programming with C++
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. Basics of C++ - functions int someFunction(double f, char c) { // … } Name Body Parameter List Return Type Name Parameter List Body Name Parameter List Return Type Body Name Parameter List Return Type
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.