View Full Version : File IO
12-11-2003, 06:04 PM
Can anyone tell me what the best io system for text file reading/writing is for opengl applications based on a windows platform when using a non-console win32 application in vc++(bit of a mouthfull).I am trying to read player attributes from text files and edit them and then write them back. Maybe im missing something but ive tried looking for hours on the internet and have found much on the subject.
Any help/links would be appreciated,
12-12-2003, 01:18 AM
For me, I'm using the simple "fscanf" and "fprintf" without any problem
12-12-2003, 07:19 AM
The C++ Standard Library provides a great collection of classes for parsing data from files (see iostream classes particularly ifstream class). I use this exclusively for reading text from files as it is much more functional, elegant, and clean than C stdio. These classes will also read and write binary data. I use C stdio for binary data read/write because I find a heavy performance hit relative to iostreams for such data.
12-12-2003, 04:29 PM
Thanks for the replies, gonna check out the ifstream stuff.
12-13-2003, 10:37 PM
I'm more prefer on FILE <stdio.h> compare to <fstream.h>, b'cause the processing of <stdio.h> is faster than <fstream.h>.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.