69,371
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <stdlib.h>
void main()
{
FILE *fp;
const int MAXLEN = 1024;
char str[MAXLEN] = {0};
if(NULL == (fp = fopen("D:\\input.txt","r")))
{
printf("File doesn't open.\n");
exit(0);
}
fscanf(fp,"%s",str);
printf("the words in the input.txt are: %s\n",str);
}
流