PDA

View Full Version : File IO



Lemmy
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,

Lemmy

Leyder Dylan
12-12-2003, 01:18 AM
For me, I'm using the simple "fscanf" and "fprintf" without any problem

pleopard
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.

Lemmy
12-12-2003, 04:29 PM
Thanks for the replies, gonna check out the ifstream stuff.

Lemmy.

cwc36
12-13-2003, 10:37 PM
Hi,

I'm more prefer on FILE <stdio.h> compare to <fstream.h>, b'cause the processing of <stdio.h> is faster than <fstream.h>.