- 源代码
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void)
{
char path[64];
scanf("%s", path);
FILE *fp = fopen(path, "r");
char ch;
while (1)
{
ch = fgetc(fp);
if (feof(fp))
{
break;
}
printf("%c", ch);
}
fclose(fp);
printf("\n");
system("pause");
return 0;
}
2.运行结果