C File Input and Output (I/O) - University of Washington
C File Input and Output (I/O)
CSE303 Todd Schiller November 9, 2009
Lecture goal
Build a practical toolkit for working with files
11/09/09
2
Files in C
#include FILE object contains file stream information Special files defined in stdio:
stdin: Standard input stdout: Standard ouput stderr: Standard error
EOF: end-of-file, a special negative integer constant
11/09/09
3
Opening and closing a file
11/09/09
4
Opening a file
FILE* fopen(char* filename, char* mode)
mode strings
"r" Open a file for reading. The file must exist.
"w" Create an empty file for writing. If a file with the same name already exists its content is erased and the file is treated as a new empty file.
"a" Append to a file. Writing operations append data at the end of the file. The file is created if it does not exist.
OUPUT
If successful, returns a pointer to a FILE object
If fails, returns NULL
11/09/09
5
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- format string vulnerability printf user input
- 6 087 lecture 4 january 14 2010 mit opencourseware
- output printf
- description syntax stata
- write output using printf use backslash to include special
- secrets of printf don colton
- cis 190 c c programming university of pennsylvania
- c function copyright © tutorialspoint
- e format specifier tricks university of virginia
- the c printf fact sheet bytellect
Related searches
- input and output calculator
- input and output table calculator
- java input and output stream
- java input and output file
- input and output equations
- input and output function math
- input and output math solver
- input and output equation
- input and output in math
- input and output equation calculator
- input and output tables
- input and output in java