TITLE: advantages of using streams over stdio PROBLEM: burris@Phys.UAlberta.CA (Bill Burris) [...] In my 3 years of using C++ I have stuck with the stdio library, because I was more interested in getting some work done, instead of learning some strange notation for doing things that worked perfectly well with printf, sprintf, fprintf, etc. [...] RESPONSE: akv@cacs.usl.edu (Anil Vijendran), 3 Dec 95 [...] A few things I can remember off the top of my head may allure you... 1. Using fprintf means the knowledge about writing to a FILE is "hardcoded" in most of your code. This can be avoided largely if you use iostreams. 2. You could design your own "stream" like thingies. For example, you could have a socket stream. If implemented properly, existing code that writes to a stream will work with your socket streams. You could even have streams that write to GUI windows and stuff. 3. Iostream is typesafe. You wouldn't get runtime errors by doing things like int i = 10; double d = 20.5; printf("i = %d f = %f", d, i); 4. With string streams, you don't have to worry about preallocating memory or having some arbit temporary limits like you have to do with sscanf. 5. You are not going to like C++ class libraries, if you don't learn iostreams. Most of them will provide support only for iostreams and not for stdio.