SlideShare a Scribd company logo
M.SUJITHA,
M.SC Student,
N.S College, Theni.
C++ STREAM CLASSES
 The features that supports to format the console
I/O operations are:
◦ Ios class functions and flags
◦ Manipulators
◦ User-defined output functions
IOS CLASS FUNCTIONS AND FLAGS:
It consists of large number of member
functions that is used to format the output in
number of ways.
 MANIPULATORS:
These are the special functions that are
included in the I/O statements to format the parameters
of a stream.
 DEFINING FIELD WIDTH:
◦ It is used to define the width of the field.
◦ Can be defined using width();
SETTING PRECISION:
 It is used to specify the to be displayed after the decimal
point.
FILLING AND PADDING:
 It is used to print the values using the larger field widths.
 It can be declared by,
cout.fill();
It is used for defining the input and
output in various forms.
Overloaded Operators >> and <<:
• It is used to give the I/O
• The >> is overloaded in istream class
• The << is overloaded in ostream class
Ex:
cin>>item1>>item2;
put() and get() Functions:
◦ It is used for the input and output .
◦ Put(c) is used to give the input
◦ Get(c) is used to get the output
Getline() and write() Functions:
• The getline() function reads a whole line of the
text and ends with a newline character.
• This function can be invoked by,
cin.getline (line,size);
• The writeline() function reads a whole line of the
text and displays an entire line.
• This function can be invoked by,
cout.write (line,size);
 The header file iomanip provides a set of functions called
manipulators which can be used to manipulate the output
formats.
 They provide the same features as that of the ios member
function and flag.
 Two or more manipulators can be,
 Cout<<manip1<<manip1<<manip<<item;
 Cout<<manip1<<item1<<manip2<<item2;
 The large amount of Data can be handled using
some devices such as floppy disk or hard disk to
store those datas.
 These datas are stored in these devices called
FILES.
 The Programs can be designed to perform the
read and write operations on those files.
 Kinds of Data Communication:
◦ Data Transfer between the console unit and the
program.
◦ Data Transfer between the program and a Diskfile.
 The I/O system contains a set of classes that define the
file handling methods.
 These includes ifstream, ofstream and fstream.
 These classes are derived from fstreambase and from the
corresponding iostream class.
 These classes are designed to manage the Disk files,
which are declared in fstream and we should include any
program in these files.
 A file stream can be declared using the classes ifstream, ofstream
and fstream that are contained in the Header file fstream.
A file can be Opened into two ways:
Using the Constructor function of the class
Using the Member function open() of the class
OPENING FILES USING Open():
 The function open() can be used to open multiple files that
use the same stream object.
file-stream-class stream-object;
stream-object.open (“file name”);
This condition is necessary for preventing
and read data from the file.
MORE ABOUT OPEN( ): FILE MODES
The function open( ) is used to open a new
and an existing file.
stream-object. open(“file
name”,mode);
Each file has two associated pointers
known as File pointers.
DEFAULT ACTIONS:
When we open a file in read-only-mode
,these input pointer is automatically set
at the beginning.
FUNCTIONS FOR MANIPULATION OF FILE POINTERS:
 seekg()-Moves a pointer to specified location
 seekp()-Moves put pointer to a specified location
 tellg()-Gives the current position of the get pointer
 tellp()-Gives the current position of the put pointer
It supports a number of member function for performing the
input/output operations on files.
Put() and get() Functions:
◦ It is used to handle single character at a time.
◦ The function put() writes a single character to the associated
stream.
◦ The function get() reads a single character to the associated
stream.
Write() and read() Functions:
◦ It is used to read and write the blocks in the binary data.
 It is used to maintain the routine task in the
data file.
 The updation can be done in:
◦ Displaying the contents of a file
◦ Modifying an existing item
◦ Adding a new file
◦ Deleting an existing file
 The reading and writing files may not be true always.
◦ A file which we are attempting to open for reading does not
exist.
◦ The file name used for a new file may already exist.
◦ We may use an invalid file name.
◦ There may not be any space in the disk for storing more data.
◦ We may attempt to perform an operation when the file is not
opened for that purpose.
 This feature facilities the supply of arguments
to the main() function.
 These arguments are supplied at the time of
invoking the program.
◦ C> exam data results
◦ Exam is the name of the file containing the program
to be executed ,data and results are the filenames
passed to the program as command-line arguments.
THANKYOU!!!

More Related Content

What's hot

File handling
File handlingFile handling
File handling
RoshanMaharjan13
 
intro unix/linux 04
intro unix/linux 04intro unix/linux 04
intro unix/linux 04
duquoi
 
Trace File Database admanistartion and manegment
Trace File Database admanistartion and manegmentTrace File Database admanistartion and manegment
Trace File Database admanistartion and manegment
Kainat Ilyas
 
intro unix/linux 02
intro unix/linux 02intro unix/linux 02
intro unix/linux 02
duquoi
 
Directory Commands - R.D.Sivakumar
Directory Commands - R.D.SivakumarDirectory Commands - R.D.Sivakumar
Directory Commands - R.D.Sivakumar
Sivakumar R D .
 
intro unix/linux 08
intro unix/linux 08intro unix/linux 08
intro unix/linux 08
duquoi
 
How to process csv files
How to process csv filesHow to process csv files
How to process csv files
Tukaram Bhagat
 
Free Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFSFree Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFS
United International University
 
Python - Lecture 11
Python - Lecture 11Python - Lecture 11
Python - Lecture 11
Ravi Kiran Khareedi
 
User and groups administrator
User  and  groups administratorUser  and  groups administrator
User and groups administrator
Aisha Talat
 
intro unix/linux 07
intro unix/linux 07intro unix/linux 07
intro unix/linux 07
duquoi
 
MS-DOS
MS-DOSMS-DOS
File Systems
File SystemsFile Systems
File Systems
Shipra Swati
 
Vb lecture notes
Vb lecture notesVb lecture notes
Vb lecture notes
alldesign
 
Course 102: Lecture 28: Virtual FileSystems
Course 102: Lecture 28: Virtual FileSystems Course 102: Lecture 28: Virtual FileSystems
Course 102: Lecture 28: Virtual FileSystems
Ahmed El-Arabawy
 
intro unix/linux 11
intro unix/linux 11intro unix/linux 11
intro unix/linux 11
duquoi
 
File allocation methods (1)
File allocation methods (1)File allocation methods (1)
File allocation methods (1)
Dr. Jasmine Beulah Gnanadurai
 
Set path
Set pathSet path
help with Linux/Unix starting
help with Linux/Unix startinghelp with Linux/Unix starting
help with Linux/Unix startingdummy
 

What's hot (20)

File handling
File handlingFile handling
File handling
 
intro unix/linux 04
intro unix/linux 04intro unix/linux 04
intro unix/linux 04
 
Trace File Database admanistartion and manegment
Trace File Database admanistartion and manegmentTrace File Database admanistartion and manegment
Trace File Database admanistartion and manegment
 
intro unix/linux 02
intro unix/linux 02intro unix/linux 02
intro unix/linux 02
 
Directory Commands - R.D.Sivakumar
Directory Commands - R.D.SivakumarDirectory Commands - R.D.Sivakumar
Directory Commands - R.D.Sivakumar
 
intro unix/linux 08
intro unix/linux 08intro unix/linux 08
intro unix/linux 08
 
How to process csv files
How to process csv filesHow to process csv files
How to process csv files
 
Free Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFSFree Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFS
 
Python - Lecture 11
Python - Lecture 11Python - Lecture 11
Python - Lecture 11
 
User and groups administrator
User  and  groups administratorUser  and  groups administrator
User and groups administrator
 
intro unix/linux 07
intro unix/linux 07intro unix/linux 07
intro unix/linux 07
 
MS-DOS
MS-DOSMS-DOS
MS-DOS
 
OSCh11
OSCh11OSCh11
OSCh11
 
File Systems
File SystemsFile Systems
File Systems
 
Vb lecture notes
Vb lecture notesVb lecture notes
Vb lecture notes
 
Course 102: Lecture 28: Virtual FileSystems
Course 102: Lecture 28: Virtual FileSystems Course 102: Lecture 28: Virtual FileSystems
Course 102: Lecture 28: Virtual FileSystems
 
intro unix/linux 11
intro unix/linux 11intro unix/linux 11
intro unix/linux 11
 
File allocation methods (1)
File allocation methods (1)File allocation methods (1)
File allocation methods (1)
 
Set path
Set pathSet path
Set path
 
help with Linux/Unix starting
help with Linux/Unix startinghelp with Linux/Unix starting
help with Linux/Unix starting
 

Similar to Managing console of I/o operations & working with files

Managing,working with files
Managing,working with filesManaging,working with files
Managing,working with files
kirupasuchi1996
 
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
ramya marichamy
 
Basics of files and its functions with example
Basics of files and its functions with exampleBasics of files and its functions with example
Basics of files and its functions with example
Sunil Patel
 
File handling in_c
File handling in_cFile handling in_c
File handling in_c
sanya6900
 
new pdfrdfzdfzdzzzzzzzzzzzzzzzzzzzzzzzzzzgggggggggggggggggggggggggggggggggggg...
new pdfrdfzdfzdzzzzzzzzzzzzzzzzzzzzzzzzzzgggggggggggggggggggggggggggggggggggg...new pdfrdfzdfzdzzzzzzzzzzzzzzzzzzzzzzzzzzgggggggggggggggggggggggggggggggggggg...
new pdfrdfzdfzdzzzzzzzzzzzzzzzzzzzzzzzzzzgggggggggggggggggggggggggggggggggggg...
AzanMehdi
 
Filehandlinging cp2
Filehandlinging cp2Filehandlinging cp2
Filehandlinging cp2
Tanmay Baranwal
 
File Handling In C++(OOPs))
File Handling In C++(OOPs))File Handling In C++(OOPs))
File Handling In C++(OOPs))
Papu Kumar
 
Stream classes in C++
Stream classes in C++Stream classes in C++
Stream classes in C++
Shyam Gupta
 
Basics of file handling
Basics of file handlingBasics of file handling
Basics of file handlingpinkpreet_kaur
 
basics of file handling
basics of file handlingbasics of file handling
basics of file handlingpinkpreet_kaur
 
File handling.pptx
File handling.pptxFile handling.pptx
File handling.pptx
VishuSaini22
 
Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008
guestd9065
 
Working with the IFS on System i
Working with the IFS on System iWorking with the IFS on System i
Working with the IFS on System iChuck Walker
 
Project report
Project reportProject report
Project report
meenalpandey
 
Java IO
Java IOJava IO
Java IO
UTSAB NEUPANE
 
CSE3146-ADV JAVA M2.pdf
CSE3146-ADV JAVA M2.pdfCSE3146-ADV JAVA M2.pdf
CSE3146-ADV JAVA M2.pdf
VithalReddy3
 
File Handling
File HandlingFile Handling
File Handling
TusharBatra27
 
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
 

Similar to Managing console of I/o operations & working with files (20)

Managing,working with files
Managing,working with filesManaging,working with files
Managing,working with files
 
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
 
Basics of files and its functions with example
Basics of files and its functions with exampleBasics of files and its functions with example
Basics of files and its functions with example
 
File handling in_c
File handling in_cFile handling in_c
File handling in_c
 
new pdfrdfzdfzdzzzzzzzzzzzzzzzzzzzzzzzzzzgggggggggggggggggggggggggggggggggggg...
new pdfrdfzdfzdzzzzzzzzzzzzzzzzzzzzzzzzzzgggggggggggggggggggggggggggggggggggg...new pdfrdfzdfzdzzzzzzzzzzzzzzzzzzzzzzzzzzgggggggggggggggggggggggggggggggggggg...
new pdfrdfzdfzdzzzzzzzzzzzzzzzzzzzzzzzzzzgggggggggggggggggggggggggggggggggggg...
 
Filehandlinging cp2
Filehandlinging cp2Filehandlinging cp2
Filehandlinging cp2
 
File Handling In C++(OOPs))
File Handling In C++(OOPs))File Handling In C++(OOPs))
File Handling In C++(OOPs))
 
Stream classes in C++
Stream classes in C++Stream classes in C++
Stream classes in C++
 
Basics of file handling
Basics of file handlingBasics of file handling
Basics of file handling
 
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++
 
File handling.pptx
File handling.pptxFile handling.pptx
File handling.pptx
 
Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008
 
Working with the IFS on System i
Working with the IFS on System iWorking with the IFS on System i
Working with the IFS on System i
 
Project report
Project reportProject report
Project report
 
Java IO
Java IOJava IO
Java IO
 
File Handling in C++
File Handling in C++File Handling in C++
File Handling in C++
 
CSE3146-ADV JAVA M2.pdf
CSE3146-ADV JAVA M2.pdfCSE3146-ADV JAVA M2.pdf
CSE3146-ADV JAVA M2.pdf
 
File Handling
File HandlingFile Handling
File Handling
 
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)
 

More from lalithambiga kamaraj

Firewall in Network Security
Firewall in Network SecurityFirewall in Network Security
Firewall in Network Security
lalithambiga kamaraj
 
Data Compression in Multimedia
Data Compression in MultimediaData Compression in Multimedia
Data Compression in Multimedia
lalithambiga kamaraj
 
Data CompressionMultimedia
Data CompressionMultimediaData CompressionMultimedia
Data CompressionMultimedia
lalithambiga kamaraj
 
Digital Audio in Multimedia
Digital Audio in MultimediaDigital Audio in Multimedia
Digital Audio in Multimedia
lalithambiga kamaraj
 
Network Security: Physical security
Network Security: Physical security Network Security: Physical security
Network Security: Physical security
lalithambiga kamaraj
 
Graphs in Data Structure
Graphs in Data StructureGraphs in Data Structure
Graphs in Data Structure
lalithambiga kamaraj
 
Package in Java
Package in JavaPackage in Java
Package in Java
lalithambiga kamaraj
 
Exception Handling in Java
Exception Handling in JavaException Handling in Java
Exception Handling in Java
lalithambiga kamaraj
 
Data structure
Data structureData structure
Data structure
lalithambiga kamaraj
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
lalithambiga kamaraj
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
lalithambiga kamaraj
 
Estimating Software Maintenance Costs
Estimating Software Maintenance CostsEstimating Software Maintenance Costs
Estimating Software Maintenance Costs
lalithambiga kamaraj
 
Datamining
DataminingDatamining
Digital Components
Digital ComponentsDigital Components
Digital Components
lalithambiga kamaraj
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating system
lalithambiga kamaraj
 
Io management disk scheduling algorithm
Io management disk scheduling algorithmIo management disk scheduling algorithm
Io management disk scheduling algorithm
lalithambiga kamaraj
 
Recovery system
Recovery systemRecovery system
Recovery system
lalithambiga kamaraj
 
File management
File managementFile management
File management
lalithambiga kamaraj
 
Preprocessor
PreprocessorPreprocessor
Preprocessor
lalithambiga kamaraj
 
Inheritance
InheritanceInheritance

More from lalithambiga kamaraj (20)

Firewall in Network Security
Firewall in Network SecurityFirewall in Network Security
Firewall in Network Security
 
Data Compression in Multimedia
Data Compression in MultimediaData Compression in Multimedia
Data Compression in Multimedia
 
Data CompressionMultimedia
Data CompressionMultimediaData CompressionMultimedia
Data CompressionMultimedia
 
Digital Audio in Multimedia
Digital Audio in MultimediaDigital Audio in Multimedia
Digital Audio in Multimedia
 
Network Security: Physical security
Network Security: Physical security Network Security: Physical security
Network Security: Physical security
 
Graphs in Data Structure
Graphs in Data StructureGraphs in Data Structure
Graphs in Data Structure
 
Package in Java
Package in JavaPackage in Java
Package in Java
 
Exception Handling in Java
Exception Handling in JavaException Handling in Java
Exception Handling in Java
 
Data structure
Data structureData structure
Data structure
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 
Estimating Software Maintenance Costs
Estimating Software Maintenance CostsEstimating Software Maintenance Costs
Estimating Software Maintenance Costs
 
Datamining
DataminingDatamining
Datamining
 
Digital Components
Digital ComponentsDigital Components
Digital Components
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating system
 
Io management disk scheduling algorithm
Io management disk scheduling algorithmIo management disk scheduling algorithm
Io management disk scheduling algorithm
 
Recovery system
Recovery systemRecovery system
Recovery system
 
File management
File managementFile management
File management
 
Preprocessor
PreprocessorPreprocessor
Preprocessor
 
Inheritance
InheritanceInheritance
Inheritance
 

Recently uploaded

Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 

Recently uploaded (20)

Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 

Managing console of I/o operations & working with files

  • 3.  The features that supports to format the console I/O operations are: ◦ Ios class functions and flags ◦ Manipulators ◦ User-defined output functions IOS CLASS FUNCTIONS AND FLAGS: It consists of large number of member functions that is used to format the output in number of ways.
  • 4.  MANIPULATORS: These are the special functions that are included in the I/O statements to format the parameters of a stream.  DEFINING FIELD WIDTH: ◦ It is used to define the width of the field. ◦ Can be defined using width(); SETTING PRECISION:  It is used to specify the to be displayed after the decimal point. FILLING AND PADDING:  It is used to print the values using the larger field widths.  It can be declared by, cout.fill();
  • 5. It is used for defining the input and output in various forms. Overloaded Operators >> and <<: • It is used to give the I/O • The >> is overloaded in istream class • The << is overloaded in ostream class Ex: cin>>item1>>item2;
  • 6. put() and get() Functions: ◦ It is used for the input and output . ◦ Put(c) is used to give the input ◦ Get(c) is used to get the output Getline() and write() Functions: • The getline() function reads a whole line of the text and ends with a newline character. • This function can be invoked by, cin.getline (line,size); • The writeline() function reads a whole line of the text and displays an entire line. • This function can be invoked by, cout.write (line,size);
  • 7.  The header file iomanip provides a set of functions called manipulators which can be used to manipulate the output formats.  They provide the same features as that of the ios member function and flag.  Two or more manipulators can be,  Cout<<manip1<<manip1<<manip<<item;  Cout<<manip1<<item1<<manip2<<item2;
  • 8.  The large amount of Data can be handled using some devices such as floppy disk or hard disk to store those datas.  These datas are stored in these devices called FILES.  The Programs can be designed to perform the read and write operations on those files.  Kinds of Data Communication: ◦ Data Transfer between the console unit and the program. ◦ Data Transfer between the program and a Diskfile.
  • 9.  The I/O system contains a set of classes that define the file handling methods.  These includes ifstream, ofstream and fstream.  These classes are derived from fstreambase and from the corresponding iostream class.  These classes are designed to manage the Disk files, which are declared in fstream and we should include any program in these files.
  • 10.  A file stream can be declared using the classes ifstream, ofstream and fstream that are contained in the Header file fstream. A file can be Opened into two ways: Using the Constructor function of the class Using the Member function open() of the class OPENING FILES USING Open():  The function open() can be used to open multiple files that use the same stream object. file-stream-class stream-object; stream-object.open (“file name”);
  • 11. This condition is necessary for preventing and read data from the file. MORE ABOUT OPEN( ): FILE MODES The function open( ) is used to open a new and an existing file. stream-object. open(“file name”,mode);
  • 12. Each file has two associated pointers known as File pointers. DEFAULT ACTIONS: When we open a file in read-only-mode ,these input pointer is automatically set at the beginning. FUNCTIONS FOR MANIPULATION OF FILE POINTERS:  seekg()-Moves a pointer to specified location  seekp()-Moves put pointer to a specified location  tellg()-Gives the current position of the get pointer  tellp()-Gives the current position of the put pointer
  • 13. It supports a number of member function for performing the input/output operations on files. Put() and get() Functions: ◦ It is used to handle single character at a time. ◦ The function put() writes a single character to the associated stream. ◦ The function get() reads a single character to the associated stream. Write() and read() Functions: ◦ It is used to read and write the blocks in the binary data.
  • 14.  It is used to maintain the routine task in the data file.  The updation can be done in: ◦ Displaying the contents of a file ◦ Modifying an existing item ◦ Adding a new file ◦ Deleting an existing file
  • 15.  The reading and writing files may not be true always. ◦ A file which we are attempting to open for reading does not exist. ◦ The file name used for a new file may already exist. ◦ We may use an invalid file name. ◦ There may not be any space in the disk for storing more data. ◦ We may attempt to perform an operation when the file is not opened for that purpose.
  • 16.  This feature facilities the supply of arguments to the main() function.  These arguments are supplied at the time of invoking the program. ◦ C> exam data results ◦ Exam is the name of the file containing the program to be executed ,data and results are the filenames passed to the program as command-line arguments.