In C++ we use an iostream class; here is some sample code, you can use this as a basis for learning more:
#include <iostream> //these are C++ header files
#include <fstream>
using namespace std; //C++ manages namespace better
// construct an ofstream (output file stream) object
ofstream myOutputFile("filename.txt"
// write to it
myOutputFile << "god bless America" << endl;
// close it
myOutputFile.close();
TO learn more about these things, do a search on C++ I/O streams and C++ file I/0. It is a complex subject matter with many nuances. But once you learn it you find it is more powerful than either VB or C.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.