+ 1
Is using \n in c++ for new line a good practice?
or should we go with endl? isn't \n specifically for C?
5 Réponses
+ 3
I believe "\n" is more practical in complex command line programming where you compose dynamically the output.
endl looks better in the code when you use a simple output.
+ 1
yeah! This is a good pratice in this and more programmer langues
0
`std::endl` calls `flush` stream while `cout << "\n"` does not, so "\n" should have better performance.
0
Not compulsory....But its a good practice just for good visual view and easy understanding!
0
If you understand the the similarities of \n and end , yes it is good pratice.