|
我用fwrite写int型数据,写入文件的全是下面的东西: €€€€€€€€€€€€€€€€€€€€€€(在记事本里全是黑色的空格) 不知道怎么回事?
代码如下:
FILE *file;
char list[3000];
int i, numread, numwritten;
/* Open file in text mode: */
if( (file = fopen( "fread.txt", "w+ b" )) != NULL )
{
for ( i = 0; i < 3000; i++ )
list[i] = (char)3456;
/* Write 25 characters to stream */
numwritten = fwrite( list, sizeof( char ), 3000, file );
printf( "Wrote %d items\n", numwritten );
fclose( file );
}
帮忙啊,在线等,急!~ |
|