tags:

views:

89

answers:

1

Possible Duplicate:
Getting a FILE* from a std::fstream

Is there a way to obtain a FILE* from an a iostream derived class? Particularly from an fstream?

+1  A: 

No, at least not in a portable way.

GCC's libstdc++ has a class called stdio_filebuf that you can use with a stream, and it does allow you to directly get the associated FILE*, but, stdio_filebuf is not a basic_filebuf, and cannot be used with basic_fstream.

Chris Jester-Young