New course! Every coder should learn Generative AI!
Try a free lesson0
What is the <<cout>>
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;
}
+ 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.