c++ - How to open a file in boost -
i relatively new using boost library c++ , wondering how open file using this. aim read json file not know how open file.
in c++, can this
int main () { ofstream myfile; myfile.open ("example.txt"); myfile << "writing file.\n"; myfile.close(); return 0; }
but how can using boost?
you can use boost::ifstream (which works boost::filesystem::path instance) or use std::ifstream read file.
the actual code depends lot on concrete use-case.
Comments
Post a Comment