+ 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
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
+ 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.