Fanion, you seem to be confused about what language you're learning. <iostream.h> is not C. In fact, it's no longer valid C++. However, ignoring the fact that you have no idea what your question is, I'll give you a few reasons for using iostreams instead of C-style I/O in C++:
1) Safer.
You no longer have to worry about matching the type of a value with a format modifier such as with the printf or scanf families. Formatted I/O using iostreams will figure out the type for you, thus removing a category or errors common to C.
2) Extensible.
You're not restricted to only the types that the standard says you can use. With printf, for example, you can't pass a user defined object and expect any meaningful output. Using iostreams, you can overload the << operator for your type and cout will print it correctly, however you want.
3) Consistent.
There are annoyingly subtle differences between the format strings of scanf and printf. A lot of people fall into the trap of using %f with scanf when they really mean %lf, because printf doesn't make that distinction. On the other hand, iostreams are very consistent in how they work, and you can generally move from input to output without an unintuitive change in syntax or semantics.
4) Flexible and Powerful.
Combining all of the advantages makes iostreams far more flexible and powerful than C-style I/O. The deeper you go, the more powerful they get.
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004