Neither C++ nor C has built input and output in the language. They
use functions(C) or other I/O objects(C++) in language library.
C++ I/O class and head file
iofs stand for three head files <iostream> <fstream> and
<sstream>. <iostream> includes <ios> automatically. They
are three main header file you should includes in your C++
application.
three classes: iostream(streambuf), fstream(filebuf),
stringstream(stringbuf)
clog is just like cerr, but it buffer it output.
C++ normally flushes the input buffer when you press enter. For
output to the display, C++ program normally flushes the output
buffer when you transmit a newline character, or reaches an input
statement.
>> and << don’t need to format string, C++ will automatically,
convert it, it’s better than printf and scanf in C language.
through inheritance, fstream and cin(cout) share the same usage.
All the knowledge can be used directly in fstream. I like it
the most.