no_rain

关于C中的文件描述符关联C++ 的 iostream

Recently I has read object-oriend multithreading using C++ and find a interesting question ,: is it possible for us to use the file descriptor and socket to be linked to the object iostream ? the answer is no... even in the book is yes ,(osolete book);

This is a frequent question, and the answer is probably "no". At least with respect to standard C++, there's no way to obtain a descriptor from an fstream object or bind an fstream object to a descriptor. The reason, as your book suggested, is implementation dependecies. Just as new doesn't necessarily have to use malloc() to allocate raw memory, the fstream library isn't required to use stdio.h as its underlying implementation.

 

posted on 2011-11-20 12:55 is-programmer 阅读(348) 评论(0)  编辑 收藏 引用 所属分类: C/C++


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


导航

<2012年3月>
26272829123
45678910
11121314151617
18192021222324
25262728293031
1234567

统计

常用链接

留言簿

随笔档案

文章分类

文章档案

搜索

最新评论

阅读排行榜

评论排行榜