I noticed that many people include iostream and ostream in C ++ programs separately, for example:
#include <iostream> #include <ostream> int main() { }
Why would anyone do this? Since iostream inherits from ostream, it should include everything in it, right? Is there any strange reason? What about simple (std :: cout) code?
stringstream iostream, <iostream>. <iostream> iostream, cout, cerr, cin clog, iostreams (, ). #include .
stringstream
iostream
<iostream>
cout
cerr
cin
clog
iostreams
#include
. ++ , , , <iostream> <ostream>, <istream>. , , <iosfwd>. , #include <iostream> istream ostream. , , , .
<ostream>
<istream>
<iosfwd>
#include <iostream>
istream
ostream
iostream istream ostream ( ++ 0x, gnu libstd++ ), ostream
:
fstream fstream ( ),
fstream
sstream ( )
sstream
iostream / (, cin, cout,...)
iosfwd - , .
iosfwd