C++ examples for File Stream:stream
Using Code That Opens a File and Writes to It
#include <iostream> #include <fstream> using namespace std; int main() //from w ww. j a v a2 s. c om { ofstream outfile("../MyFile.txt"); outfile << "Hi" << endl; outfile.close(); return 0; }