C File Input and Output (I/O)
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
- c programming tutorial
- string class in c
- c file input and output i o
- lecture 4 notes arrays and strings
- c strings and pointers city university of new york
- note 2 string and file reading and writing
- string lab 2 input and output using strings
- instructions on using strings in c
- arithmetic expressions in c
- csci 515 c c programming fall 2001
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