Suppose I have a file opened with the C syntax
FILE* fp = fopen("whatever.txt", "w");
// Library function needs FILE* to work on
libray_function(fp);
// Now I'd like to copy the contents of file to std::cout
// How???
fclose(fp);
I would like to be able to copy the contents of that file in a C++ ostream (like a stringstream
or maybe even std::cout
). How can I do that?