+ 1

is it gonna be a problem in the future if i just use \n everytime i wanna write a something new instead of cout<<"" everytime

14th Jan 2017, 3:10 AM
jonathin
2 ответов
+ 3
i think the better way to go for a new line is cout << "hey\nBye"; with \n or cout << "hey" << endl << "bye"; with endl
14th Jan 2017, 3:13 AM
Kawaii
Kawaii - avatar
+ 1
There also a big advantage of endl over \n cout<<endl ; is equivalent to cout<<"\n"<<flush; flush is used to clear buffer input. that's why endl is very much used in working with file which is opened in binary mode.
14th Jan 2017, 11:02 AM
Rishabh Agrawal
Rishabh Agrawal - avatar