+ 1
What does endl mean in this?
int x ;x = 4 + 6; cout << x endl;
6 Answers
+ 4
First, it should be ...x << endl. endl adds a system dependent END of Line to your output.
+ 2
Like pressing ENTER in a text document.
+ 2
It does not end a function, does the exact same job as \n
+ 1
@John Wells, so ending the line of my output, does that mark the end of my function as well? Because I thought that endl was simply an archaic version of \n, which indents the text for me
like
this.
+ 1
The \n is the archaic version. There exist systems where \r is the end of line character. endl will use the correct character on both types of system.