, . stdio.h io.h.
, , .. , : , .. /++ fopen (), . , .. , . :
FILE * ;
fopen ( 1, 2);
1 , , : d:\\work\\sved.txt sved.txt, d, work; , .
2 :
w , , , , ;
r ; , ;
a ;
r +, w + ;
a + , a, , .
(t), b .
, fopen NULL.
fclose ( ), , fclose (f);
: void fcloseall (void);
, :
#include <stdio.h>
...
FILE *f_my;
if(! (f_my = fopen(rez.txt, r+t))) {
puts(\n !);
// ShowMessage (" ");
return;
}
... //
fclose(f_my);
...
fprintf () fscanf (), printf () scanf (), (. ..1), , .
.
. , fp (FILE * fp;):
1) int fread (void * ptv, int size, int n, fp) n size fp , ptv ( );
2) int fwrite (void * ptv, int size, int n, fp) n size , ptv fp;
|
|
3) int fileno (fp) fp ( , );
4) long filelength (int ) ;
5) int chsize (int , long pos) fp, pos;
6) int fseek (fp, long size, int kod) size kod: 0 ; 1 ; 2 ;
7) long ftell (fp) fp (-1 );
8) int feof ( ) ;
9) int fgetpos ( , long * pos) pos ; 0.