How can I override a C++ standard-library class function? In my application, I use ofstream objects in many different places of code. And now I want to open files i
ofstream
#include #include class gstream: public std::ofstream { void open(const std::string& filename, ios_base::openmode mode,int stuff) { //put stuff here } }; int main() { gstream test; //io stuff return 0; }
seems to work here.