Where and how to use 'endl' | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Where and how to use 'endl'

26th Oct 2016, 10:52 AM
Sahil Solanki
Sahil Solanki - avatar
4 Answers
+ 7
when you need to get a new line you can use cout<< endl;
26th Oct 2016, 12:09 PM
Lara
Lara - avatar
+ 6
You use endl when you want to go to the new line
26th Oct 2016, 12:19 PM
Remmae
Remmae - avatar
+ 3
endl is the newline character in C++. Look at this: cout << "Hello!" << endl; cout << "This is fun!" << flush; cout << "Test" << endl; this code will print the following in console: Hello! This is fun!Test endl will make output after it appear on the next line, while flush will make output after it appear on the same line.
26th Oct 2016, 11:13 AM
Adrian Nesse Wiik
Adrian Nesse Wiik - avatar
0
hey Remmae thanks
26th Oct 2016, 3:01 PM
Sahil Solanki
Sahil Solanki - avatar