+ 3

What is the difference between writing cout in this way 1. Cout<<"this"<<"is"<<"awesome" and this way 2.Cout <<"this is awesome"

14th Dec 2016, 3:00 PM
NadaKarim
6 Antworten
+ 4
The advantage of the first way is that you could print out variables on the same line as text.
20th Dec 2016, 3:44 AM
Andrew Michel
Andrew Michel - avatar
+ 3
well the first way just shoves it all together since there are no spaces in your message it just appends the strings together. the second way just outputs one string. first way: thisisawesome, second way: this is awesome.
14th Dec 2016, 4:07 PM
Cory Clapp
Cory Clapp - avatar
+ 2
as programmer you must know you need space in memory for your programme the first way take space from memory more than second way
20th Dec 2016, 10:08 AM
Wissam Almonaged
Wissam Almonaged - avatar
+ 1
actually if you space the words they will be spaced. I guess its just to teach you the function
20th Dec 2016, 10:56 PM
Okafor Bryce
Okafor Bryce - avatar
0
in 1. there will be no spaces 2. there line comes as it is
15th Dec 2016, 9:12 AM
Gabish Mahawar
Gabish Mahawar - avatar
0
you can write in both ways but 2nd one is better.
18th Dec 2016, 2:50 PM
rajvardhan mane