What is the <<cout>> | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the <<cout>>

16th Jun 2017, 1:01 PM
Abil
2 Answers
+ 3
hi, The predefined object cout is an instance of ostream class. The cout object is said to be "connected to" the standard output device, which usually is the display screen. The cout is used in conjunction with the stream insertion operator, which is written as << which are two less than signs as shown in the below example. #include <iostream> using namespace std; int main( ) { char str[] = "Hello C++"; cout << "Value of str is : " << str << endl; }
16th Jun 2017, 1:08 PM
Nanda Balakrishnan
+ 2
What do you mean? If you mean something like this: cout << "Hello"; The above statement is used to output "Hello" to the screen. You can replace "Hello" with any message you want.
16th Jun 2017, 1:04 PM
Caleb Jore
Caleb Jore - avatar