What is endl in c++ and how it works?
- Posted:
- 3+ months ago by saibalaji
- Topics:
- work, programming
Answers (1)
Inserts a new-line character and flushes the stream.
>>It is used for putting a carriage return line feed at the end of output so the next output is on the next line, not continued on the same line
cout << "ex1" << endl << "ex 2" << " ex2";
would produce
ex1
ex2 ex2
Good day.. :)