库函数-创建和打开
FILE *fopen(const char *filename,const char *mode)
filename:
打开的文件名(包含路径,quesheng)
#include
main{}
{
FILE *fp;
char ch;
if((fp = fopen("ci.txt","rt")) == NULL)
{
printf("\n cannot open file strike any key exit!");
getch();
exit(1);
}
ch = fgetc(ch);
while(ch != EOF)
{
putchar(ch);
ch = fgetc(fp);
}
fclose(fp);
}