Skip to content

Instantly share code, notes, and snippets.

@foxoman
Last active August 29, 2015 14:02
Show Gist options
  • Save foxoman/7091234add4aa039879d to your computer and use it in GitHub Desktop.
Save foxoman/7091234add4aa039879d to your computer and use it in GitHub Desktop.
OPENING FILE USING CONSTRUCTOR in C++
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ofstream myDB("DB.text");
myDB << "Writing to file using fstream constructor!" << endl;
myDB.close ();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment