11FileIOSmall

11FileIOSmall - CMSC 106 Lecture Set#11 File Input/Output...

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

View Full Document Right Arrow Icon
1 CMSC 106 Lecture Set #11 – File Input/Output Set Started: Friday, November 18, 2011 Terminating execution void exit(int status); s prototype in stdlib.h s "immediately" ends execution when called s status is viewable by the shell s exit(0); generally means OK s exit(1); or any nonzero generally means error encountered s can use " echo $? " in tcsh to see the exit status of the last program executed s can use constants EXIT_SUCCESS and EXIT_FAILURE instead of 0/1 2 Types of streams s Text streams are composed of lines of text, each terminated by a newline s there are library functions to deal with text streams in three ways: s character-oriented I/O s line-oriented I/O s formatted I/O s Binary streams are composed of just plain data 3
Background image of page 1

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

View Full Document Right Arrow Icon
2 The type FILE * s Variables of type FILE * are used to represent open streams s Three predefined streams for every program: s stdin : standard input (redirect with < ) s stdout : standard output (redirect with > ) s stderr : standard error (redirect both
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 3

11FileIOSmall - CMSC 106 Lecture Set#11 File Input/Output...

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