69,371
社区成员
发帖
与我相关
我的任务
分享
FILE* pf = fopen( "c:\\tstbuf.txt", "a+" );
if( pf )
{
pf = fprintf( pf, "%s", buf );
fclose( pf );
}
/* fgets exmaple */
#include <stdio.h>
int main()
{
FILE * pFile;
char string [100];
pFile = fopen ("myfile.txt" , "r");
if (pFile == NULL) perror ("Error opening file");
else {
fgets (string , 100 , pFile);
puts (string);
fclose (pFile);
}
return 0;
}
lz
你的
printf("您要下载的文件名:%s\n",buf);
打印出来的结果是??