0
why dont you use endl; when printing strings?
string a = "whats up"; cout << a; return 0;
3 Respostas
+ 3
you can
you do not with cin..
cout << "hi" << endl; // ok
cin >> a << endl // not ok
you example goes
string a = "whats up";
cout << a << endl;
+ 2
generally we can use but in your context I think when we use endl it remove everything in buffer which take some time..so, in order to be reduce time complexity we don't use.But using endl is good practice..
0
Because it only prints one string and it's unneccessary (unless you use system("exit"); ).