One is C and one is C++. Tomato, tomato. (That expression doesn't work nearly as well when you write it out.) My guess is that you are not likely to see a performance difference.
A very C++ inclined, anti-C person will probably tell you something along the lines of fstream
being able to deal with differing types with more ease. With FILE
you have two options -- deal in bytes or deal in format strings. Since printf
or fwrite
et al. don't know what the "real" type of their arguments are this makes it easier to screw up. There's also the fact that a C++ class will have a destructor and so you get cleanup "for free" when the object goes out of scope. (Although... Do you really want something like fflush
to silently happen in a destructor? Probably not.) To these sorts of arguments I would say that it's not really that much of a burden to use FILE
, but hey, some people feel more strongly than I on these matters.
Eventually it will boil down to what exactly your application is trying to do, and it may be that FILE
, fstream
, or both can adequately suit your needs.
Pick what works, be flexible with what other people choose, understand the arguments and don't get too religious about it. That's my advice. :-)