Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

C++

PRESENTATION
Veeresh Basetti
Vikas Sakkari
Vinayak Bhushetti
MEET OUR TEAM

VEERESH BASETTI VINAYAK BHUSHETTI VIKAS SAKKARI


Object Oriented Program

TOPICS
 I/O STREAM
 FILES
 ​TYPES OF FILES
 ADVANTAGES OF FILES
 BINARY FILES
Object Oriented Program

I/O
STREAM
Object Oriented Program
I/O Streams

Here are the lists of standard file handling classes:

In order to handle files in C++, we use classes which are derived from
fstream base and the associated iostream class and are explicitly
designed to handle disk files.

1. fstream: This is a built in library, it provides the two file handling classes
named ifstream and ofstream.

2. ifstream: This file handling class in C++ signifies the input file stream and
is applied for reading information from files.

3. ofstream: This file handling class in C++ signifies the output file stream and
is applied to create files for writing information to files.
Object Oriented Program

FILES
Object Oriented Program

FILES
 What is file?
A file can be defined as a place on disk (secondary memory) wherein we store
data for further or future use.
Examples:
Text files : *.txt, *.c, *.cpp, *.py, *.doc, *.pdf, *.xls, *.bmp, *.jpg, etc.
Binary files : *.exe, *.com, etc.

 Why files?
 Sometimes, it is necessary to store input or output data for future and is
possible by creating files.
 Sometimes, we need to give more inputs to the written program and is
possible by giving existing file as input.
 Sometimes, write output to a file and is possible by file handling.
Object Oriented Program

TYPES OF FILES
TEXT FILES

 The bits are represent printable character.


 One byte per character for ASCII, the most common code.
 Example: Java source and Text files.
 So is any files created with a “Text Editor”.

 BINARY FILES

 The bits represents other types of encoded information, such as


Excutable Instruction or Numeric Data
 These files are easily read by the computers not humans
 They are not “Printable Files”
Object Oriented Program

ADVANTAGES OF
FILES

 Can edit data, Prepare ahead of Time


 Can rerun file without reentering data
 Can examine output as leisure
 Can display output to screen or print
 Can use output as inputinto another program
THANK
YOU

You might also like