文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>C语言实例55:打开和关闭文件

C语言实例55:打开和关闭文件

时间:2010-07-02  来源:hnrainll

#include <stdio.h>
#include <stdlib.h>

int main()
{
    FILE *fp;
    char ch, filename[10];

    printf("Pleas input the name of file:");
    scanf("%s", filename);

    if((fp = fopen(filename,"r")) == NULL)
    {
        printf("Cannot open the file.\n");
        exit(0);
    }

    fclose(fp);

    system("pause");
    return 0;
}


相关阅读 更多 +
排行榜 更多 +
随大同

随大同

冒险解谜 下载
弯曲路径:无尽奔跑

弯曲路径:无尽奔跑

休闲益智 下载
工艺融合对战

工艺融合对战

策略塔防 下载