0
What is the difference between.
cout <<"this"<<"is"<<"swesome"; and cout <<"this is awesome";
1 Odpowiedź
+ 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;
}