file handling methods

Started by
0 comments, last by andyZER0 19 years, 11 months ago
I''m having difficulties deciding how to read/write data in my games. In my C++ books, I''ve been taught to use ofstreams and ifstreams and what not. Yet, when I look up the source of some C++ games, they use the ol'' FILE* (the C way of handling files right...?). Furthermore, there''re some pieces of code that use both fstream''s and FILE*''s (some MD3 loader on gametutorials.com). I''ve sort of noticed each method''s strengths and weaknesses. (scanf is good stuff, but I can >> my way out of that :-p) Anyone have any recommendations on which file handling method to use? (FILE*/stdio.h/C way? vs. ofstream/ifstream/fstream.h/C++ way?) Have opinions on why one way better than another? Is there one way everyone else is using? I just wanna keep up with the times...or not :-p Thanks in advance.
Advertisement
Personally, I don''t really see the difference.

But, I recommend you go straight C++ and use STL. (Which would mean use streams)

This topic is closed to new replies.

Advertisement