Advertisement

So which would be better for a game project...

Started by February 16, 2001 04:38 PM
0 comments, last by Tyrian 23 years, 11 months ago
Buffered File I/O or unbuffered File I/O. In terms of speed and efficiency? (Using the two types of C++ file I/O)
Well, it generally doesn''t matter, because you generally won''t be reading/writing files in real time except in cases of streaming of audio/video (which is a special case) or writing a log file.

If you''re writing a log file, then it''s preferable to use unbuffered, because if you use buffered and your program crashes before the file is closed then the file won''t be written and you''ll have no log. With unbuffered, no matter if the program crashes or the file is closed correctly, you''ll still have a readable file.

Hope this helped.

This topic is closed to new replies.

Advertisement