So which would be better for a game project...
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.
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
Popular Topics
Advertisement
Recommended Tutorials
Advertisement