首页 > 其他 > 详细

Linux 底下使用C 对文件进行遍历

时间:2014-02-12 01:57:46      阅读:355      评论:0      收藏:0      [点我收藏+]

#include <stdio.h>
#include <stdlib.h>
main (int argc,char *argv[])
{
char ch;
FILE *fp;
int i;

if((fp=fopen("test.txt","r"))==NULL)
{
printf("Can not open the file:\n");
exit(0);
}

while((ch=fgetc(fp))!=EOF)
putchar(ch);
fclose(fp);

 

}

Linux 底下使用C 对文件进行遍历

原文:http://www.cnblogs.com/aspirant/p/3544982.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!