C++ ofstream write

Description

C++ ofstream write

#include <iostream> 
#include <fstream> 

using namespace std; 

int main() /*  w ww. j  ava2s  .c o  m*/
{ 
    ofstream outfile("../MyFile.txt"); 
    outfile << "Hi" << endl; 
    outfile.close(); 

    return 0; 
}



PreviousNext

Related