SlideShare une entreprise Scribd logo
1  sur  16
Télécharger pour lire hors ligne
Gandhinagar Institute of
Technology
Subject : CPU (2110003)
Active Learning Assignment
Branch : Computer Engineering
Group:-BG -2
Prepared by : - Sunil Patel (201707000098)
Guided By: Prof. Mihir shah
 Using input/output files
 General files I/O steps
 Streams
 Predifined console
streams
 File modes
 File pointers
 Binary file operations
 A computer file
is stored on a secondary storage device (e.g.,
disk);
is permanent;
can be used to provide input data to a program
or receive output data from a program, or both;
must be opened before it is used.
[f@@@ @ @ @
liu@mrulio
 stream - a sequence of characters
 interactive (iostream)
1) cin - input stream associated with keyboard.
2) cout - output stream associated with display.
 file (fstream)
1) ifstream - defines new input stream (normally
associated with a file).
2) ofstream - defines new output stream (normally
associated with a file).
 Declare a file name variable.
 Associate the file name variable with the disk file name.
 Open the file
 Use the file
 Close the file
 Astream is a series of bytes, which act either as a
source from which data can be extracted or as a
destination to which the output can be sent. Streams
resemble the producer and consumer model
 The producer produces the items to be consumed by
the consumer. The producer and the consumers are
connected by the C++ operators >> or <<. For instance
, the keyboard exhibits the nature of only a
producer,printer or monitor screen exhibit the nature of
only a consumer. Whereas , a file stored on the disk ,
can behave as a producer or consumer, depending upon
the operation initiated on it.
 C++ contains several predefined streams that are
opened automatically when the execution of a program
starts.
1) cin :standard input (usually keyboard) corresponding
to stdio in C
2) cout :standard output (usually screen) corresponding
• to stdout in C
3) cerr :standard error output (usually screen)
corresponding to stderr in C
4) clog : A fully buffered version of cerr (No C equivalent)
 Convenient way to deal large quantities of data.
 Store data permanently (until file is deleted).
 Avoid typing data into program multiple times.
 Share data between programs.
 We need to know:
 how to "connect" file to program how to
tell the program to read data
 how to tell the program to write data error
checking and handling EOF
Name Description
ios::in Open file to read
ios::out Open file to write
ios::app All the date you write, is put at the end of the file.
It calls ios::out
ios::ate All the date you write, is put at the end of the file.
It does not call ios::out
ios::trunc Deletes all previous content in the file. (empties the file)
ios::nocreate If the file does not exist, opening it with the open()
function gets impossible.
ios::noreplace If the file exists, trying to open it with the open() function, returns an
error.
ios::binary Opens the file in binary mode.
 Opening a file in ios::out mode also opens it in the
ios::trunc mode by default. That is, if the file already
exists, it is truncated
 Both ios::app and ios::ate set the pointers to the end
of file, but they differ in terms of the types of
operations permitted on a file. The ios::app allows to
add data from end of file, whereas ios::ate mode
allows to add or modify the existing data anywhere
in the file. In both the cases the file is created if it
is non existent.
 The mode ios::app can be used only with output files
 The stream classes ifstream and ofstream open
filesin read and write modes by default.
 Each file has two associated pointers known as the file pointers. One
of them is called the input pointer or get pointer.
 The get pointer specifies a location from which the current reading
• operation is initiated
• Other is called the output pointer or put pointer.
• The put pointer specifies a location from where the current writing
operation is initiated
• We can use these pointers to move through the files while reading or
writing.
• The input pointer is used for reading the contents of a given file
location and the output pointer is used for writing to a given file
location.
Functions for manipulation of file pointers
seekg() Moves get pointer (input) to a specified
location. seekp() Moves put pointer (output) to a
specified location. tellg() Gives the current position
of the get pointer.
tellp() Gives the current position of the put pointer.
Functions for binary file handling get(): read a byte and point to the next
byte to read
put(): write a byte and point to the next location for write
read(): block reading
write(): block writing
flush():Save data from the buffer to the output file.
CPU (2110003) Active Learning Assignment on File I/O Streams

Contenu connexe

Tendances (20)

Filepointers1 1215104829397318-9
Filepointers1 1215104829397318-9Filepointers1 1215104829397318-9
Filepointers1 1215104829397318-9
 
file handling, dynamic memory allocation
file handling, dynamic memory allocationfile handling, dynamic memory allocation
file handling, dynamic memory allocation
 
Files in c++
Files in c++Files in c++
Files in c++
 
basics of file handling
basics of file handlingbasics of file handling
basics of file handling
 
File handling in c++
File handling in c++File handling in c++
File handling in c++
 
C++ files and streams
C++ files and streamsC++ files and streams
C++ files and streams
 
Files in c++
Files in c++Files in c++
Files in c++
 
File handling in c++
File handling in c++File handling in c++
File handling in c++
 
Data file handling
Data file handlingData file handling
Data file handling
 
File Handling in C++
File Handling in C++File Handling in C++
File Handling in C++
 
C++ Files and Streams
C++ Files and Streams C++ Files and Streams
C++ Files and Streams
 
Filehadnling
FilehadnlingFilehadnling
Filehadnling
 
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)
 
Filehandling
FilehandlingFilehandling
Filehandling
 
Data file handling in c++
Data file handling in c++Data file handling in c++
Data file handling in c++
 
File handling in c++
File handling in c++File handling in c++
File handling in c++
 
File Handling In C++(OOPs))
File Handling In C++(OOPs))File Handling In C++(OOPs))
File Handling In C++(OOPs))
 
working file handling in cpp overview
working file handling in cpp overviewworking file handling in cpp overview
working file handling in cpp overview
 
File Handling In C++
File Handling In C++File Handling In C++
File Handling In C++
 
Files and streams In Java
Files and streams In JavaFiles and streams In Java
Files and streams In Java
 

Similaire à CPU (2110003) Active Learning Assignment on File I/O Streams

Basics of file handling
Basics of file handlingBasics of file handling
Basics of file handlingpinkpreet_kaur
 
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 referenceanuvayalil5525
 
File management in C++
File management in C++File management in C++
File management in C++apoorvaverma33
 
Filesinc 130512002619-phpapp01
Filesinc 130512002619-phpapp01Filesinc 130512002619-phpapp01
Filesinc 130512002619-phpapp01Rex Joe
 
VIT351 Software Development VI Unit5
VIT351 Software Development VI Unit5VIT351 Software Development VI Unit5
VIT351 Software Development VI Unit5YOGESH SINGH
 
Lec 49 - stream-files
Lec 49 - stream-filesLec 49 - stream-files
Lec 49 - stream-filesPrincess Sam
 
Programming in C Session 4
Programming in C Session 4Programming in C Session 4
Programming in C Session 4Prerna Sharma
 
Stream classes in C++
Stream classes in C++Stream classes in C++
Stream classes in C++Shyam Gupta
 
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdf
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdfEASY UNDERSTANDING OF FILES IN C LANGUAGE.pdf
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdfsudhakargeruganti
 
Deletion of a Record from a File - K Karun
Deletion of a Record from a File - K KarunDeletion of a Record from a File - K Karun
Deletion of a Record from a File - K KarunDipayan Sarkar
 
Managing console i/o operation,working with files
Managing console i/o operation,working with filesManaging console i/o operation,working with files
Managing console i/o operation,working with filesramya marichamy
 

Similaire à CPU (2110003) Active Learning Assignment on File I/O Streams (20)

Basics of file handling
Basics of file handlingBasics of file handling
Basics of file handling
 
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
 
File management in C++
File management in C++File management in C++
File management in C++
 
Chapter4.pptx
Chapter4.pptxChapter4.pptx
Chapter4.pptx
 
Files and streams
Files and streamsFiles and streams
Files and streams
 
IOStream.pptx
IOStream.pptxIOStream.pptx
IOStream.pptx
 
Filesinc 130512002619-phpapp01
Filesinc 130512002619-phpapp01Filesinc 130512002619-phpapp01
Filesinc 130512002619-phpapp01
 
Data file handling
Data file handlingData file handling
Data file handling
 
File Handling
File HandlingFile Handling
File Handling
 
VIT351 Software Development VI Unit5
VIT351 Software Development VI Unit5VIT351 Software Development VI Unit5
VIT351 Software Development VI Unit5
 
Lec 49 - stream-files
Lec 49 - stream-filesLec 49 - stream-files
Lec 49 - stream-files
 
file_c.pdf
file_c.pdffile_c.pdf
file_c.pdf
 
7 Data File Handling
7 Data File Handling7 Data File Handling
7 Data File Handling
 
Programming in C Session 4
Programming in C Session 4Programming in C Session 4
Programming in C Session 4
 
File Handling
File HandlingFile Handling
File Handling
 
File Handling
File HandlingFile Handling
File Handling
 
Stream classes in C++
Stream classes in C++Stream classes in C++
Stream classes in C++
 
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdf
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdfEASY UNDERSTANDING OF FILES IN C LANGUAGE.pdf
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdf
 
Deletion of a Record from a File - K Karun
Deletion of a Record from a File - K KarunDeletion of a Record from a File - K Karun
Deletion of a Record from a File - K Karun
 
Managing console i/o operation,working with files
Managing console i/o operation,working with filesManaging console i/o operation,working with files
Managing console i/o operation,working with files
 

Dernier

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 

Dernier (20)

Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 

CPU (2110003) Active Learning Assignment on File I/O Streams

  • 1. Gandhinagar Institute of Technology Subject : CPU (2110003) Active Learning Assignment Branch : Computer Engineering Group:-BG -2 Prepared by : - Sunil Patel (201707000098) Guided By: Prof. Mihir shah
  • 2.
  • 3.  Using input/output files  General files I/O steps  Streams  Predifined console streams  File modes  File pointers  Binary file operations
  • 4.  A computer file is stored on a secondary storage device (e.g., disk); is permanent; can be used to provide input data to a program or receive output data from a program, or both; must be opened before it is used.
  • 5. [f@@@ @ @ @ liu@mrulio
  • 6.  stream - a sequence of characters  interactive (iostream) 1) cin - input stream associated with keyboard. 2) cout - output stream associated with display.  file (fstream) 1) ifstream - defines new input stream (normally associated with a file). 2) ofstream - defines new output stream (normally associated with a file).
  • 7.  Declare a file name variable.  Associate the file name variable with the disk file name.  Open the file  Use the file  Close the file
  • 8.  Astream is a series of bytes, which act either as a source from which data can be extracted or as a destination to which the output can be sent. Streams resemble the producer and consumer model  The producer produces the items to be consumed by the consumer. The producer and the consumers are connected by the C++ operators >> or <<. For instance , the keyboard exhibits the nature of only a producer,printer or monitor screen exhibit the nature of only a consumer. Whereas , a file stored on the disk , can behave as a producer or consumer, depending upon the operation initiated on it.
  • 9.  C++ contains several predefined streams that are opened automatically when the execution of a program starts. 1) cin :standard input (usually keyboard) corresponding to stdio in C 2) cout :standard output (usually screen) corresponding • to stdout in C 3) cerr :standard error output (usually screen) corresponding to stderr in C 4) clog : A fully buffered version of cerr (No C equivalent)
  • 10.  Convenient way to deal large quantities of data.  Store data permanently (until file is deleted).  Avoid typing data into program multiple times.  Share data between programs.  We need to know:  how to "connect" file to program how to tell the program to read data  how to tell the program to write data error checking and handling EOF
  • 11. Name Description ios::in Open file to read ios::out Open file to write ios::app All the date you write, is put at the end of the file. It calls ios::out ios::ate All the date you write, is put at the end of the file. It does not call ios::out ios::trunc Deletes all previous content in the file. (empties the file) ios::nocreate If the file does not exist, opening it with the open() function gets impossible. ios::noreplace If the file exists, trying to open it with the open() function, returns an error. ios::binary Opens the file in binary mode.
  • 12.  Opening a file in ios::out mode also opens it in the ios::trunc mode by default. That is, if the file already exists, it is truncated  Both ios::app and ios::ate set the pointers to the end of file, but they differ in terms of the types of operations permitted on a file. The ios::app allows to add data from end of file, whereas ios::ate mode allows to add or modify the existing data anywhere in the file. In both the cases the file is created if it is non existent.  The mode ios::app can be used only with output files  The stream classes ifstream and ofstream open filesin read and write modes by default.
  • 13.  Each file has two associated pointers known as the file pointers. One of them is called the input pointer or get pointer.  The get pointer specifies a location from which the current reading • operation is initiated • Other is called the output pointer or put pointer. • The put pointer specifies a location from where the current writing operation is initiated • We can use these pointers to move through the files while reading or writing. • The input pointer is used for reading the contents of a given file location and the output pointer is used for writing to a given file location.
  • 14. Functions for manipulation of file pointers seekg() Moves get pointer (input) to a specified location. seekp() Moves put pointer (output) to a specified location. tellg() Gives the current position of the get pointer. tellp() Gives the current position of the put pointer.
  • 15. Functions for binary file handling get(): read a byte and point to the next byte to read put(): write a byte and point to the next location for write read(): block reading write(): block writing flush():Save data from the buffer to the output file.