+ 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
2 odpowiedzi
+ 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
+ 1
cout<< in c++ is like printf in c . you can print your var or ...