#include <stdio.h>
#include <stdlib.h>
int main()
{
char ch;
FILE *fp=fopen("D:\\test.txt","r");
if(fp==NULL){
printf("error!\n");
return 0;
}
printf("从文件中读取的内容: ");
ch=fgetc(fp);
while(ch!=EOF)
{
putchar(ch);
ch=fgetc(fp);
}
fclose(fp);
return 0;
}