Home | Site map | Contact
>>Chronoviator Official Website
www.chronoviator.com
ronald@chronoviator.com
Ronald G. Bernardo
Multimedia Specialist (ilc.upmin.edu.ph)
University of the Philippines Mindanao


Tuesday, October 21, 2008

File Handling

C++ File Handling I/O

The most fundamental point to understand about the C++ I/O system is that it operates on streams. A stream is an abstraction that either produces or consumes information. A stream is linked to a physical device by the C++ I/O system. All streams behave in the same manner, even if the actual physical devices they are linked to differ. Because all streams act the same, the same I/O functions and operators can operate on virtually any type of device. For example, the same method that you use to write to the screen can be used to write to a disk or to the printer.

In its most common form, a stream is a logical interface to a file. As C++ defines the term “file,” it can refer to a disk file, the screen, the keyboard, a port, a file on tape, and so on. Although files differ in form and capabilities, all streams are the same. The advantage to this approach is that to you, the programmer, one hardware device will look much like any other. The stream provides a consistent interface.

A stream is linked to a file through an open operation. A stream is disassociated from a file through a close operation.

There are two types of streams: text and binary. A text stream is used with characters. When a text stream is being used, some character translations may take place. For example, when the newline character is output, it may be converted into a carriage return–linefeed sequence. For this reason, there might not be a one-to-one correspondence between what is sent to the stream and what is written to the file. A binary stream can be used with any type of data. No character translations will occur, and there is a one-to-one correspondence between what is sent to the stream and what is actually contained in the file.

Downloads

File Handling Presentation
Phone Book Sample System

Labels:


Commercial Flash Templates

Our team can develop:
Website Templates Blog Templates
Flash Website Templates OSC Templates
E-Classroom Website using a CMS
   
   
 
Copyrights (c) 2008 Interactive Websites Co
All rights reserved