What is the meaning of the word "cout" in C/C++?
Well, it is very common in programming languages to have keywords responsible for printing the data output.
Some are classic like echo
, print
, printf
and write
, etc.
But in C/C++
we have cout
. For me, this word makes no sense to be related to data printing(I speak in a translation, for example). Even I did not find a translation for that word.
For example:
int main()
{
cout << "Imprimindo o famoso HELLO WORLD!!!\n";
return 0;
}
What is the meaning of the word cout
after all?
1 answers
cout
is not a language keyword, it is a default library object and can only be used through the namespace std
and inclusion of the header iostream
.
The meaning would be console output. Just like cin
would be console input. Both are streams input and output data through the console.
Some consider that the " c " would be character. At least is what the creator of the language . It's weird but it makes some sense because basically everything that is sent to the stream ends up being converted to characters that go to the console (contrary to what other types think are not printed, only one string, so every type needs to be able to be converted to string somehow, even without creating a new object).