SlideShare a Scribd company logo
Sanjivani Rural Education Society’s
Sanjivani College of Engineering, Kopargaon-423 603
(An Autonomous Institute, Affiliated to Savitribai Phule Pune University, Pune)
NAAC ‘A’ Grade Accredited, ISO 9001:2015 Certified
Department of Computer Engineering
(NBA Accredited)
Prof. I. B. Tirse
Assistant Professor
E-mail :tirseishwaricomp@sanjivani.org.in
Contact No: 7507113718
Subject- Object Oriented Programming (CO212)
Unit 5 – Files and Streams
Topic – 5.1 Data Hierarchy, Stream and Files, Stream
Classes
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 2
3
• All programs we looked earlier:
Introduction to files


input data from the keyboard.
output data to the screen.
• Output would be lost as soon as we exit from the program.
• How do we store data permanently?


We can use secondary storage device.
Data is packaged up on the storage device as
data structures called files.
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 3
4
Streams Usage
• We have used streams already
 c i n
Input from stream object connected to keyboard
cout
Output to stream object connected to screen
• C a n define other streams
 To or from files
Used similarly as cin, cout
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 4
5
File input and output streams
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 5
6
Streams
 File Input Stream – reads data from disk file to the program.
 The I/O system of C++ contains following classes :
 File output Stream – writes data to the disk file from the program.



ofstream – provides output operations on files
fstream – supports for simultaneous input and
output operations on files
ifstream – provides input operations on files
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 6
Stream Classes
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 7
The Data Hierarchy
7
 From smallest to largest
 Bit (binary digit)
 1 or 0
 Everything in computer ultimately represented as
bits
 Character set
 Digits, letters, symbols used to represent data
 Every character represented by 1's and 0's
 Byte: 8 bits
 Can store a character (char)
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 8
The Data Hierarchy (contd.)
8
 From smallest to largest (continued)
Field: group of characters with some meaning
e.g., Your name
Record: group of related fields
 struct or class in C++
File: group of related records
Payroll for entire company
Database: group of related files
Payroll, accounts-receivable.
Thank You..
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 9

More Related Content

Similar to 5.1 Data hierarchy, Stream and files, Stream Classes.pptx

Pf cs102 programming-8 [file handling] (1)
Pf cs102 programming-8 [file handling] (1)Pf cs102 programming-8 [file handling] (1)
Pf cs102 programming-8 [file handling] (1)
Abdullah khawar
 
Chapter 6
Chapter 6Chapter 6
Chapter 6
siragezeynu
 
File handling in_c
File handling in_cFile handling in_c
File handling in_c
sanya6900
 
Computer software
Computer softwareComputer software
Computer software
SonirAhmed
 
Address Binding Scheme
Address Binding SchemeAddress Binding Scheme
Address Binding Scheme
Rajesh Piryani
 
Filehandlinging cp2
Filehandlinging cp2Filehandlinging cp2
Filehandlinging cp2
Tanmay Baranwal
 
[計一] Basic r programming final0918
[計一] Basic r programming   final0918[計一] Basic r programming   final0918
[計一] Basic r programming final0918Yen_CY
 
[計一] Basic r programming final0918
[計一] Basic r programming   final0918[計一] Basic r programming   final0918
[計一] Basic r programming final0918Chia-Yi Yen
 
Resume
ResumeResume
Resume
Xin Tang
 
resume-8.1-software
resume-8.1-softwareresume-8.1-software
resume-8.1-softwareTianbo Zhang
 
14 mass data engineering v1.00_en
14 mass data engineering v1.00_en14 mass data engineering v1.00_en
14 mass data engineering v1.00_en
confidencial
 
Wong Kien Hoe Resume
Wong Kien Hoe ResumeWong Kien Hoe Resume
Wong Kien Hoe ResumeKien Hoe Wong
 
Justin_Wang_Resume
Justin_Wang_ResumeJustin_Wang_Resume
Justin_Wang_ResumeJustin Wang
 
Files in C++.pdf is the notes of cpp for reference
Files in C++.pdf is the notes of cpp for referenceFiles in C++.pdf is the notes of cpp for reference
Files in C++.pdf is the notes of cpp for reference
anuvayalil5525
 
A Deep Dive into Structured Streaming: Apache Spark Meetup at Bloomberg 2016
A Deep Dive into Structured Streaming:  Apache Spark Meetup at Bloomberg 2016 A Deep Dive into Structured Streaming:  Apache Spark Meetup at Bloomberg 2016
A Deep Dive into Structured Streaming: Apache Spark Meetup at Bloomberg 2016
Databricks
 
VIT351 Software Development VI Unit5
VIT351 Software Development VI Unit5VIT351 Software Development VI Unit5
VIT351 Software Development VI Unit5
YOGESH SINGH
 

Similar to 5.1 Data hierarchy, Stream and files, Stream Classes.pptx (20)

Pf cs102 programming-8 [file handling] (1)
Pf cs102 programming-8 [file handling] (1)Pf cs102 programming-8 [file handling] (1)
Pf cs102 programming-8 [file handling] (1)
 
Chapter 6
Chapter 6Chapter 6
Chapter 6
 
File handling in_c
File handling in_cFile handling in_c
File handling in_c
 
Computer software
Computer softwareComputer software
Computer software
 
Address Binding Scheme
Address Binding SchemeAddress Binding Scheme
Address Binding Scheme
 
Filehandlinging cp2
Filehandlinging cp2Filehandlinging cp2
Filehandlinging cp2
 
[計一] Basic r programming final0918
[計一] Basic r programming   final0918[計一] Basic r programming   final0918
[計一] Basic r programming final0918
 
[計一] Basic r programming final0918
[計一] Basic r programming   final0918[計一] Basic r programming   final0918
[計一] Basic r programming final0918
 
Resume
ResumeResume
Resume
 
resume-8.1-software
resume-8.1-softwareresume-8.1-software
resume-8.1-software
 
Resume
ResumeResume
Resume
 
14 mass data engineering v1.00_en
14 mass data engineering v1.00_en14 mass data engineering v1.00_en
14 mass data engineering v1.00_en
 
Wong Kien Hoe Resume
Wong Kien Hoe ResumeWong Kien Hoe Resume
Wong Kien Hoe Resume
 
PKSengupta_TechAssoc
PKSengupta_TechAssocPKSengupta_TechAssoc
PKSengupta_TechAssoc
 
Justin_Wang_Resume
Justin_Wang_ResumeJustin_Wang_Resume
Justin_Wang_Resume
 
Files in C++.pdf is the notes of cpp for reference
Files in C++.pdf is the notes of cpp for referenceFiles in C++.pdf is the notes of cpp for reference
Files in C++.pdf is the notes of cpp for reference
 
David Huff
David HuffDavid Huff
David Huff
 
REEJA_CV1
REEJA_CV1REEJA_CV1
REEJA_CV1
 
A Deep Dive into Structured Streaming: Apache Spark Meetup at Bloomberg 2016
A Deep Dive into Structured Streaming:  Apache Spark Meetup at Bloomberg 2016 A Deep Dive into Structured Streaming:  Apache Spark Meetup at Bloomberg 2016
A Deep Dive into Structured Streaming: Apache Spark Meetup at Bloomberg 2016
 
VIT351 Software Development VI Unit5
VIT351 Software Development VI Unit5VIT351 Software Development VI Unit5
VIT351 Software Development VI Unit5
 

Recently uploaded

Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
Kamal Acharya
 
shape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptxshape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptx
VishalDeshpande27
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
PrashantGoswami42
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Introduction to Casting Processes in Manufacturing
Introduction to Casting Processes in ManufacturingIntroduction to Casting Processes in Manufacturing
Introduction to Casting Processes in Manufacturing
ssuser0811ec
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdf
AbrahamGadissa
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
ssuser9bd3ba
 
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES  INTRODUCTION UNIT-IENERGY STORAGE DEVICES  INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
VigneshvaranMech
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
Kamal Acharya
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
fundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projectionfundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projection
jeevanprasad8
 
Laundry management system project report.pdf
Laundry management system project report.pdfLaundry management system project report.pdf
Laundry management system project report.pdf
Kamal Acharya
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
Kamal Acharya
 
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
Amil baba
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
fluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerfluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answer
apareshmondalnita
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdf
Kamal Acharya
 

Recently uploaded (20)

Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 
shape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptxshape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptx
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Introduction to Casting Processes in Manufacturing
Introduction to Casting Processes in ManufacturingIntroduction to Casting Processes in Manufacturing
Introduction to Casting Processes in Manufacturing
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdf
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
 
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES  INTRODUCTION UNIT-IENERGY STORAGE DEVICES  INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
fundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projectionfundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projection
 
Laundry management system project report.pdf
Laundry management system project report.pdfLaundry management system project report.pdf
Laundry management system project report.pdf
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
fluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerfluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answer
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdf
 

5.1 Data hierarchy, Stream and files, Stream Classes.pptx

  • 1. Sanjivani Rural Education Society’s Sanjivani College of Engineering, Kopargaon-423 603 (An Autonomous Institute, Affiliated to Savitribai Phule Pune University, Pune) NAAC ‘A’ Grade Accredited, ISO 9001:2015 Certified Department of Computer Engineering (NBA Accredited) Prof. I. B. Tirse Assistant Professor E-mail :tirseishwaricomp@sanjivani.org.in Contact No: 7507113718 Subject- Object Oriented Programming (CO212) Unit 5 – Files and Streams Topic – 5.1 Data Hierarchy, Stream and Files, Stream Classes
  • 2. DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 2 3 • All programs we looked earlier: Introduction to files   input data from the keyboard. output data to the screen. • Output would be lost as soon as we exit from the program. • How do we store data permanently?   We can use secondary storage device. Data is packaged up on the storage device as data structures called files.
  • 3. DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 3 4 Streams Usage • We have used streams already  c i n Input from stream object connected to keyboard cout Output to stream object connected to screen • C a n define other streams  To or from files Used similarly as cin, cout
  • 4. DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 4 5 File input and output streams
  • 5. DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 5 6 Streams  File Input Stream – reads data from disk file to the program.  The I/O system of C++ contains following classes :  File output Stream – writes data to the disk file from the program.    ofstream – provides output operations on files fstream – supports for simultaneous input and output operations on files ifstream – provides input operations on files
  • 6. DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 6 Stream Classes
  • 7. DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 7 The Data Hierarchy 7  From smallest to largest  Bit (binary digit)  1 or 0  Everything in computer ultimately represented as bits  Character set  Digits, letters, symbols used to represent data  Every character represented by 1's and 0's  Byte: 8 bits  Can store a character (char)
  • 8. DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 8 The Data Hierarchy (contd.) 8  From smallest to largest (continued) Field: group of characters with some meaning e.g., Your name Record: group of related fields  struct or class in C++ File: group of related records Payroll for entire company Database: group of related files Payroll, accounts-receivable.
  • 9. Thank You.. DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 9