VC读写函数详解(针对文件)
VC读写函数.当前文件指针位置获取函数long ftell( FILE *stream );参数:stream 文件指针返回值:当前文件指针的位置实例:#include stdio.h
FILE *stream;
void main( void ){?? long position;?? char list[100];?? if( (stream = fopen( ftell.c, rb )) != NULL )?? {????? /* Move the pointer by reading data: */????? fread( list, sizeof( char ), 100, stream );????? /* Get position after read: */????? position = ftell( stream );????? printf( Position after trying to read 100 bytes: %ld\n,????????????? position );????? fclose( stream );?? }}输出:Position after trying to read 100 bytes: 100
2.文件的打开函数FILE *fopen( const char *filenam
原创力文档

文档评论(0)