标准IO库 知识点百问《APUE》 chapter-5
2016-02-23 13:21
423 查看
1-标准IO库提供的三种类型的buffering:
Fully buffered(全缓冲)Line buffered(行缓冲)
unbuffered(无缓冲):典型标准错误流
2-行缓冲会遇到的两个问题:
遇到新行符号前填满了buffer所有line-buffered和
unbufferedstream输入请求都会
flushline-buffered的输出流
3-三个标准流采用哪种buffering:
标准error总是unbuffered
标准input/output 在
terminal device的时候是
line buffered;否则是
fully buffered
4-对于打开的流,有三种无形式IO(unformated IO):
Character-at-a-time I/O. We can
reador
writeone character at a time。
Line-at-a-time I/O.If we want to
reador
writea line at a time, we use fgets and fputs.
Direct I/O(binary I/O). This type of I/O is supported by the
freadand
fwritefunctions. These two functions are often used for
binary fileswhere we read or write a structure with each operation.
5-getc
和fgetc
之间的差别?以及注意点?
getc宏
fgetc函数
1.
getc的参数一定不能是有副作用的表达式
2. 可以使用
fgetc的地址,作为函数指针传入其他function
3. 调用
fgetc消耗的时间比
getc长
6-一般文件的缓冲模式?
默认全缓冲7-临时文件有哪些相关调用?
tmpnam,tempnamtmpfile, mkstemp
8-tmpnam,tempname的缺点?
在返回唯一pathname和用该pathname创建临时文件之间有一段空隙。其他的进程可能在该空隙内用同样的pathname创建了文件。这样会导致严重的后果。相关文章推荐
- 标准IO库《APUE》 Chapter-5
- POJ 2442 Sequence 堆的思想的应用 STL 堆学习
- UINavigationBar
- Win32项目搭建Duilib界面个人体会总结
- new AlertDialog.Builder 提示错误
- n-Queens(n皇后)问题的两种方法
- 搜索栏有内容搜索商品,清空UITextField返回搜索历史
- POJ—Building a Space Station
- Emulation currently requires hardware acceleration
- UIViewController的切换效果
- 视图上移与键盘弹回
- UI设计师不可不知的安卓屏幕知识
- 2.UIImageView
- Hibernate的Query和Session对象的示例
- Jenkins进阶系列之——15一个完整的JENKINS下的ANT BUILD.XML文件
- uiview的contentmode的使用
- 2016太原UI设计师讲PS、AI{图像描摹}如何使用?
- iOS9.0以后那些被不推荐使用(deprecated)方法之:sendAsynchronousRequest was deprecated in iOS 9、UIAlertView was depr
- Android UI效果之绘图篇(四)
- UISearchController