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 阅读(335) 评论(0)  编辑 收藏 引用 所属分类: C/C++


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


导航

<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

统计

常用链接

留言簿

随笔档案

文章分类

文章档案

搜索

最新评论

阅读排行榜

评论排行榜