Username: Password:

复制txt文档中的内容
来源: ChinaUnix博客  作者: 发布时间:2007-01-01 12:04:00


#include
#include
int   main()   
  {   
          char   *sFile="e:\\test\\a.txt";   
          char   *dFile="e:\\test\\b.txt";   
          char   ch;   
          FILE   *sfp,*dfp;   
   
          if   ((sfp=fopen(sFile,"r"))==NULL)   
            {   
                  printf("%s",sFile);   
                  printf("源文档打开失败:%s",sFile);   
                  exit(1);   
   
            }   
          if   ((dfp=fopen(dFile,"w"))==NULL)   
            {   
                  printf("目标文档打开失败:"+*dFile);   
                  exit(1);   
            }   
        while   ((ch=getc(sfp))!=EOF)   
  
          {   
                  putc(ch,dfp);   
            
          }   
   
          fclose(sfp);   
          fclose(dfp);   
          return(0);   
  }


喜欢本文,那就收藏到:

    Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪ViVi 365Key网摘 天极网摘 和讯网摘 博拉网 POCO网摘 添加到饭否 QQ书签 Digbuzz我挖网
相关评论  我也要评论
还没有关于此文章的相关评论!
  • 昵称: (为空则显示guest)
  • 评论分数: ★ ★ ★★★ ★★★★ ★★★★★
  • 评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
  • 导航
    赞助商
    文章类别
    订阅