PDA

View Full Version : Reading From Files


Was It Me?
08-22-2006, 06:08 PM
Anyone,

In your opinion, what is the best, fastest, easiest, most reliable way to read from files in C++?

Was It Me?
08-22-2006, 06:47 PM
Appending to previous:

In Windows. (MFC or other)

I know of a few, but what's the best...

Richard Phipps
08-22-2006, 07:20 PM
The standard IO library that people use with C or C++ is fine for most things.

Was It Me?
08-22-2006, 07:26 PM
Thanks! I was guessing that it might be the best...

ben
08-23-2006, 02:09 PM
Definitely stick with the standard library (in general I like the C fread over iostreams, but that's me). Also, beware of things like filename capitalisation. While Win32 doesn't care, if you ever port your application to another platform, you might run into problems.

Was It Me?
08-23-2006, 02:39 PM
Right. I have already implemented C fopen(), fget(), ect. file handling. I decided that I prefer the C functions over iostreams as well. :)

The only annoying thing is that, for my purposes, I have to trim the LF/CR chars off the end of each line.