What does it mean cout << a << b << c in C++? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What does it mean cout << a << b << c in C++?

How does << works? I don t know that because at University we are only learning C Java SQL and Python

16th Nov 2016, 1:10 PM
Antonio Francone
Antonio Francone - avatar
2 Answers
+ 5
cout is a command which takes in generic primitive arguments in this case the arguments are a b c to compare to C printf under the assumption that a is int b is char c is float it would look as follows printf("%d%c%f", a, b, c); also notice that the cout function does not require the type of the argument like printf. it can take a generic primitive (string,char,int,....) and print it to the screen unlike printf
16th Nov 2016, 1:28 PM
Burey
Burey - avatar
+ 1
cout<< in c++ is like printf in c . you can print your var or ...
18th Nov 2016, 8:39 AM
Mim masoumi
Mim masoumi - avatar