Quiz Entry - updated: 2026.06.23
What does << do in C++ with cout?
<< is the stream insertion operator — it sends ("flows") data into an output stream such as cout.
cout << "Value: " << 42 << endl;
How it works:
coutis the standard output stream object (from<iostream>)<<is overloaded to accept many types (strings, ints, floats…), so you don't need format specifiers- Each
<<returns the stream again, which is why you can chain them in one statement
Equivalent in C:
printf("Value: %d\n", 42);
Tip: Think of << as "flows into" — data flows into the stream. (>> points the other way, pulling data out.)