Jump to content
  • Advertisement

Archived

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

Goober King

Dev-C++ file writing

This topic is 5301 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

Well I decided to try using Dev-C++ as I pick up the programing thing again. I have been using MVC6 intro. Which was all well and fine if you don''t want to pass the EXEs around. So as I was pulling some of my startup code over to Dev I ran into a problem writing files. Just trying to open a log file to send info to. I didn''t think there was much room for error with... ostream logfile("logfile.txt"); logfile << "Send Info and stuff to file\n"; logfile.close(); but the thing said "''ostream'' is used as a type, but is not defined as a type." I can''t find any info that shows any real other way to do things. Anyone know what the hell it wants or had this happen? This should be basic stuff. I''d rather be spending time on a real bug and not something stupid like this.

Share this post


Link to post
Share on other sites
Advertisement
Did you include <fstream>? Also, ostream lives in namespace std. So either use std::ostream, or put a using declaration in your source file (either using namespace std; or using std::ostream;).

edit: for that matter try using ofstream instead of ostream. Creating an ostream by file name may not make much sense.

[edited by - SiCrane on March 18, 2004 2:50:19 PM]

Share this post


Link to post
Share on other sites
std::ostream and using std::ostream give me this

no matching function for call to `std::basic_ostream >::close()''

Whatever that means.

Share this post


Link to post
Share on other sites
quote:
Original post by SiCrane
for that matter try using ofstream instead of ostream. Creating an ostream by file name may not make much sense.




Ok I think it liked that one.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!