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?
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?
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
.