C 语言的读取文件

#include <stdio.h>
main()
{
    FILE *fp;
    if((fp=fopen("in.txt","rt"))==NULL)
    {
        printf("错误:文件不存在");
        getch();
        exit(1);
    }
    while(fscanf(fp,"%d",&a) != EOF ) 
	{
		......
	}
......

  

posted @ 2015-06-06 16:04  纸牌  阅读(156)  评论(0编辑  收藏  举报