Advertisement

...file not opening

Started by November 23, 2000 11:12 PM
0 comments, last by slightlywhacked 24 years, 2 months ago
for some reasson the file isnt opening.. #include fstream.h; #include iostream.h; //the above have the greater more and less than signs around them is just that if i put the signs.. the stuff inside them dissapear ofstream writefile; void datfile() { writefile.open("scores.dat", ios::out); writefile << "High Score" <<endl; writefile.close() } and yes.. im sure the function is called thanx in advance
BAHcows go moomoos go cow
void datfile()
{
ofstream writefile("scores.dat");
writefile << "High Score";
writefile.close();
}

//note use: ofstream writefile("scores.dat",ios::app); to appened to a file

also iostream.h is include in fstream.h so you only to include fstream.h

hope this helps

This topic is closed to new replies.

Advertisement