| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1018 人关注过本帖
标题:C语言比较两文件异同(txt)
只看楼主 加入收藏
Gilbert
Rank: 2
等 级:论坛游民
帖 子:6
专家分:13
注 册:2012-9-26
收藏
得分:2 
看了一下楼主貼的代码, 对于fgets函数来说,是读取一行包括行尾的换行符'\n',若要两行比较的话,要将'\n'去掉换成'\0’才算是一个完整的字符串

Linux 下 man 配置对 fgets 的说明
       fgets()  reads in at most one less than size characters from stream and stores them into the
       buffer pointed to by s.  Reading stops after an EOF or a newline.  If a newline is read,  it
       is  stored into the buffer.  A terminating null byte ('\0') is stored after the last charac‐
       ter in the buffer.
2012-09-26 17:51
快速回复:C语言比较两文件异同(txt)
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016525 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved