// Writing Files

#include <iostream>
#include <fstream>

using namespace std;

void main() {

	ofstream outFile( "output.txt", ios::out);

	if ( !outFile ) {
		cerr << "File could not be opened for write.\n";
		exit(1);
	}

	int x=8;

	outFile << "Use outFile just like cout" << endl;
	outFile << "value of x = " << x << endl;

} //end main()