0

What is the difference between.

cout <<"this"<<"is"<<"swesome"; and cout <<"this is awesome";

21st Nov 2016, 6:11 AM
stephen haokip
stephen haokip - avatar
1 Antwort
+ 4
for starters, you won't have spaces in the first one thisisawesome the first way is used to when you want to print out variables which hold values and build somewhat of a dynamic sentences which depends on the input your program is getting so if you want to greet someone with a cout you could do: int main(){ string name; cout << "Enter your name: "; cin >> name; cout << "Hello " << name << ", how are you today?"; return 0; }
21st Nov 2016, 6:23 AM
Burey
Burey - avatar