A
Alf P. Steinbach
* mlimber:
Formally there is, or might be, depending on one's faith in intentions instead
of the Literal Word (TM) of the standard.
<iostream> only forward-declares the eight or so standard iostream objects.
Practically I doubt there is any compiler where <iostream> isn't enough,
because it would break so much code to require <ostream> in addition, but just
to help people understand that compilesWithMyCompiler != isStandard, I usually
add <ostream> in my examples.
Cheers,
- Alf
[snip]Mike said:#include <iostream> /* declares 'cin' and 'cout' */
#include <ostream> /* declares 'endl' */
There's no need to include ostream if iostream is already included.
Formally there is, or might be, depending on one's faith in intentions instead
of the Literal Word (TM) of the standard.
<iostream> only forward-declares the eight or so standard iostream objects.
Practically I doubt there is any compiler where <iostream> isn't enough,
because it would break so much code to require <ostream> in addition, but just
to help people understand that compilesWithMyCompiler != isStandard, I usually
add <ostream> in my examples.
Cheers,
- Alf