Is using \n in c++ for new line a good practice? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is using \n in c++ for new line a good practice?

26th Dec 2016, 1:47 PM
Arch.ary
Arch.ary - avatar
2 Answers
0
`std::endl` calls `flush` stream while `cout << "\n"` does not, so "\n" should have better performance.
26th Dec 2016, 1:56 PM
Ondřej Doněk
Ondřej Doněk - avatar
0
It's is a good practise But mostly use it because it makes your output screen look nice and organized
26th Dec 2016, 3:16 PM
Amol Jandial
Amol Jandial - avatar