Discussion Notes 9

Discussion Notes 9 - EME 5 Fall 2007 Discussion 9 Streams...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: EME 5 Fall 2007 Discussion 9 Streams and Files The C I/O system supplies a consistent interface to the C programmer independent of the actual device being accessed. That is, the C I/O system provides a level of abstraction between the programmer and the device. This abstraction is called a stream and the actual device is called a file . In C, a file may be anything from a disk file to a keyboard/scanner or monitor/printer. In C, the term file pointer is also used to mean stream . File Pointers A statement such as FILE *fp; declares a file pointer variable fp . The data type FILE is defined in stdio.h. A FILE object holds all the internal information about the connection to the associated file, such as the file position indicator and buffering information. FILE objects are allocated and managed internally by the I/O functions. User programs should only deal with pointers to these objects (that is, FILE * ) rather than the objects themselves. The file pointers below are defined in stdio.h as standard streams for a program.standard streams for a program....
View Full Document

This note was uploaded on 04/21/2008 for the course EME 005 taught by Professor Cheng during the Fall '07 term at UC Davis.

Page1 / 8

Discussion Notes 9 - EME 5 Fall 2007 Discussion 9 Streams...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online