5
Contributors
7
Replies
8
Views
8 Years
Discussion Span
Last Post by x3mario
0

so a cout needs the three header files to be in effect...

NO. cout only needs <iostream>

#include <iostrem>
using std::cout;

int main()
{
    cout << "Hello World\n";
    return 0;
}
0

after the #include<iostream>, there's a statement,
"using std::cout;", what is it function?

0

cout is an object of class ostream that represents the standard output stream. It corresponds to the cstdio stream stdout.
By default, most systems have their standard output set to the console, where text messages are shown, although this can generally be redirected.
Because cout is an object of class ostream, we can write characters to it either as formatted data using for example the insertion operator (ostream::operator<<) or as unformatted data using the write member function, among others (see ostream).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.