Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

slightlywhacked

...file not opening

This topic is 6423 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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" <

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!