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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, at least not in a portable way.
GCC’s
libstdc++has a class calledstdio_filebufthat you can use with a stream, and it does allow you to directly get the associatedFILE*, but,stdio_filebufis not abasic_filebuf, and cannot be used withbasic_fstream.