/* Note:Your choice is C IDE */
#include
void main( void )
{
FILE *stream;
char list[30];
int i, numread, numwritten;
if( (stream = fopen( "C:\\my.txt", "r+t" )) != NULL )
{
numread = fread( list, sizeof( char ), 25, stream );
printf( "读取数据长度 = %d\n", numread );
list[numread]='\0';
printf( "数据 = %.25s\n", list );
fclose( stream );
}
else
printf( "打不开\n" );
}
在其目录下新建一个my.txt文件,输入汉字保存,然后执行就可以看到汉字的读取了