0
Why would you need to use multiple "<<" in one cout line?
Ex: cout <<This <<is<<awesome!; When you can just use: cout<< "This is awesome!";
4 Answers
+ 2
First This is not a good example altough multiple << can be used in case of varialbes and this is known as cascafind.As c++ accept only one variable at a time so cascading can be used
Ex:
cout << num1 << num2;
insted of
cout << num1;
cout << num2;
+ 1
If you wanted to insert a variable it would save you from having to type more lines of code. The all-text example is not a very good one.
0
The frequent use of << operator is called cascading, this is beneficial in the case when we have to give a value of a variable.
example
cout <<"sum="<<add<<"product="<<pro;
where add and pro are predefined local variables of the programme.
0
my english not well, but i will try to let you understand.
not must, just you can do that
becuz the operation '<<' return cout
I mean (cout << something) equal to (cout). so the cout can be used with many very interesting ways.