FILE * and istream: connect the two?

后端 未结 3 2007
误落风尘
误落风尘 2020-12-10 15:37

Suppose I \"popen\" an executable, I get a FILE* in return. Furthermore, suppose I\'d like to \"connect\" this file to an istream object for easier

3条回答
  •  不知归路
    2020-12-10 16:22

    There is no standard way but if you want a quick solution you can get the file descriptor with fileno() and then use Josuttis' fdstream. There may be similar efforts around but I used this in the distant past and it worked fine. If nothing else it should be a very good map to implementing your own.

提交回复
热议问题