, , <stdio.h>. typedef FILE. , FILE. .
:
FILE * ___1,
* ___2 ,...,
* __ _N;
- , , -.
, , FILE. :
___ = fopen ( ,
)[;]
, () (, "n").
, :
" r " ;
'' w " ( );
" " ( , ),
, . " r+ ", " w+ " " a+ ". .
t, - b (, "+b" "b+").
, \n. .
FILE * infilep, * outfilep;
infilep= fopen (c:\data.txt,r);
outfilep= fopen (c:\results.txt,w);
fopen , FILE, , .
fopen , : NULL (stdio.h).
== null => (null pointer).
!!!! null(\0).
if (infilep==null)
printf ( c:\data.txt\n);
fclose ( )[;]
. 0 , , EOF.
Define EOF (1) , , ; NULL, ).
fclose (infilep);
, (stdin, stdout, stdprn, stderr stdaux),
fcloseall()[;]
, EOF. int.
|
|
fflush ( )[;]
0, , EOF.
feof ( )[;]
, , 0.
fgetc, fputc, fgetchar fputchar .
fgetc ( )[;]
int.
EOF.
fputc ( , )[;]
. , int - ; EOF.
fgets ( , )[;]
. :
1. .
2. .
fputs ( , )[;]
. , int- ; EOF.
fscanf (u , " "[, ])[;]
. , ; EOF. , scanf, , .
fprintf ( ,
" "[, ])[;]
. , (); EOF.
rewind ( );
.