Jump to content
  • Advertisement

Archived

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

SirGorthon

Saving Stuff in a Console App

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

Advertisement
Any half-decent C++ book will cover IO streams, including file streams, which is what you want. Read about those.



Don''t listen to me. I''ve had too much coffee.

Share this post


Link to post
Share on other sites

include

using namespace std;

int main()
{
ifstream infile;
infile.open("/file.txt", ios::binary); // binary is just what i
// use, you'll be using
// ascii most likely, then
// you just dont worry
// about the second
// argument.
return 0;
}


[edit: damn tags]

-eldee
;another space monkey;
[ Forced Evolution Studios ]


::evolve::

[edited by - eldee on August 13, 2002 11:55:37 AM]

Share this post


Link to post
Share on other sites
In
ofstream a_file(filename, ios::noreplace);

it says
C:\Program Files\Microsoft Visual Studio\MyProjects\UltimateFile\UltimateFile.cpp(31) : error C2039: ''noreplace'' : is not a member of ''basic_ios >''
C:\Program Files\Microsoft Visual Studio\MyProjects\UltimateFile\UltimateFile.cpp(31) : error C2065: ''noreplace'' : undeclared identifier

but in the tutorials at cprogramming.com it says it will work.

I''m confused

Share this post


Link to post
Share on other sites
SirGorthon:

The problem is that ios::noreplace is not supported. I checked Schildt and the MSDN, and could find no reference to ios::noreplace. Removing it will stop the errors.

John.

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!