+ 1
Where and how to use 'endl'
4 Answers
+ 7
when you need to get a new line you can use
cout<< endl;
+ 6
You use endl when you want to go to the new line
+ 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.
0
hey Remmae thanks