Jump to content
  • Advertisement

Archived

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

MadProgrammer

File Manip in win32

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

whats the best (and preferably easiest) way to do file i/o in a win32 app? i have used fstream in dos, and it works in win32, but i don''t know if there is a *better* way to do it. i was reading up on the changes from c to c++, and one of them was updating the old streams (printf, fstream, etc). could someone clear me up? the madprogrammer

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by MadProgrammer
whats the best (and preferably easiest) way to do file i/o in a win32 app? i have used fstream in dos, and it works in win32, but i don''t know if there is a *better* way to do it. i was reading up on the changes from c to c++, and one of them was updating the old streams (printf, fstream, etc). could someone clear me up?

the madprogrammer


All you need to do the simplest file manip in win32 is


// just make sure you include fstream.h then as follow
char temp;

ifstream filein( "blah.bla" ); // file input
ofstream fileout( "blah.bla" ); // file output

filein >> temp;
fileout << temp;


Now, to me, that''s the easiest way to do file I/O manips... hope this helps you out.


"And that''s the bottom line cause I said so!"

Cyberdrek
Headhunter Soft
A division of DLC Multimedia

Resist Windows XP''s Invasive Production Activation Technology!

"gitty up" -- Kramer

Share this post


Link to post
Share on other sites
well, the win32 way has more features than the
simple IO

CreateFile()
ReadFile()
WriteFile()
CloseHandle()
GetFileSize();
SetFilePointer();

check them out, its quite simple to use
and fast..


{ Stating the obvious never helped any situation !! }

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!