Coming from a C background, I've been using fwrite and fread to write/read binary values (either a single value, or an array of values). Is there a preferred method for doing the same in C++?
Of course, I did notice that fread/fwrite documentation exists on this site, but printf as well -- even though streams are perhaps the preferred way of text I/O in C++ (I think).
Should I stick with fread/fwrite, or is there a preferred alternative that is "more C++"? Thank you!
Thank you both for your replies! Looks easy enough -- I'll give it a try.
Actually, I did a Google search for my problem and someone had asked this before on another message board and the reply was along the lines of "fread and fwrite still work fine for C++". Which is of course true...but if you're going to let others see your C++ code, you don't want to make it obvious that you were once a C programmer and can't change... :-)