0

What is meant by cout in c++?

23rd May 2020, 11:41 AM
Tejas Pattanshetti
Tejas Pattanshetti - avatar
2 Answers
+ 1
The identifierĀ coutĀ stands for Common OUTput.Ā coutĀ is a predefined variable inĀ C++Ā that indicates you are going to output a stream of characters to an output device.Ā coutĀ uses an operator called the insertion operator (<<)
23rd May 2020, 11:58 AM
Arsenic
Arsenic - avatar
0
On most program environments, the standard output by default is the screen, and the C++ stream object defined to access it isĀ cout. For formatted output operations,Ā coutĀ is used together with theĀ insertion operator, which is written asĀ <<Ā (i.e., two "less than" signs). TheĀ <<Ā operator inserts the data that follows it into the stream that precedes it. In the examples above, it inserted the literal stringĀ Output sentence, the numberĀ 120, and the value of variableĀ xĀ into the standard output streamĀ cout. Notice that the sentence in the first statement is enclosed in double quotes (") because it is a string literal, while in the last one,Ā xĀ is not. The double quoting is what makes the difference; when the text is enclosed between them, the text is printed literally; when they are not, the text is interpreted as the identifier of a variable, and its value is printed instead.
23rd May 2020, 12:25 PM
ź§ą¼’ā˜¬Badā˜¬Boyā˜¬ą¼’ź§‚
ź§ą¼’ā˜¬Badā˜¬Boyā˜¬ą¼’ź§‚ - avatar