my bad had brain fart when writing the mode
this is the format for .open function call,
your_fstream_object.open( const char* szName, int nMode, int nProt = filebuf::openprot );
You can also open a file by calling the constructor, to check out all the specifics of fstream goto
www.msdn.com ; type fstream::fstream in the search
#include <fstream> //dont forget to #include header file
using namespace std;
int main () {
fstream filestr;
// open somefile with append mode and default protection
// Note if file does not reside in same file as sorce code you must specify the full path and name
filestr.open("somefile.txt", ios::app);
// >> i/o operations here <<
filestr.close();
return 0;
}