+ 2
In c++ can we use \n as a new line character insted of endl
5 ответов
+ 5
Do not write irrelevant things like "upvote the question" in description.
Add details to your question and add code related to it.
Answer to your question is "yes, you can use both endl and \n in c++ and they serve same purpose of new line in your code.
Refer to the example given here -> https://stackoverflow.com/questions/213907/stdendl-vs-n
+ 3
Yes you can use \n instead of endl
+ 3
You can use "\n" instead of endl
Difference is endl causes a buffer flush and \n do not
In Competitive Coding \n is preferred over endl as buffer flush is slower
+ 2
If you need to flush the buffer use endl else use just \n
0
"\n" and "endl" both do the same
they are twins.