现在的位置: 首页 > 综合 > 正文

对《THE C PROGRAMMING LANGUAGE》读书笔记的一点补充

2014年01月22日 ⁄ 综合 ⁄ 共 650字 ⁄ 字号 评论关闭

我学习C语言用的也是《THE C PROGRAMMING LANGUAGE》,老实说第一遍学是什么

也没看懂,觉得不是什么好教材,但是后来读了很多编程的书后才发现,这本书是

真正的经典,强烈建议所有学习编程语言的人来读,不管你是学Java还是C++。
看了CSDN博客上的关于这本书的一篇读书笔记,觉得有一点可以补充的,就写下来


关于EOF
什么是EOF?
EOF就是文件结束的意思,EOF的值是多少?其实在《THE C PROGRAMMING LANGUAGE

》中作者并没有直接告诉我们,作者说的是:“EOF is an integer defined in

<stdio.h>,but the specific numeric value doesn't matter as long as it is

not the same as any char value.By using the symbolic constant,we are

assured that nothing in the program depends on the specific numeric

value.”
如果你确实想知道EOF的值,那么利用练习中提供的程序可以知道你所使用的系统

是如何规定EOF的。同时也说的很明白:“In our system EOF is -1,but it may

vary from system to system.That's why standard symbolic constants like

EOF help make your profram portable.”
所以简单的说EOF就是-1就没有把EOF的渊源讲清楚。

【上篇】
【下篇】

抱歉!评论已关闭.