+ 2

What is the significance of the "endl;"?

Is it different than "\n"?

18th Jun 2016, 3:38 AM
Josh
5 Answers
+ 1
Practically no. \n can be inserted anywhere between " " so you can make new lines inside instead of writing << endl over and over again
18th Jun 2016, 4:25 AM
Sardor
Sardor - avatar
+ 1
Yes, they're different. "\n" is a string member of size 1. But endl is a object that adds "\n" to you output. Summary: In practical reasons "\n" is faster.
18th Jun 2016, 5:05 AM
Dmitry Pudov
Dmitry Pudov - avatar
+ 1
1 символ, я имел ввиГу:) 1 character
18th Jun 2016, 6:01 AM
Dmitry Pudov
Dmitry Pudov - avatar
+ 1
аа всё ŠæŠ¾Š½ŃŠ» :-)
18th Jun 2016, 6:02 AM
Sardor
Sardor - avatar
0
Дмитрий вроГе размер "\n" 4?
18th Jun 2016, 5:58 AM
Sardor
Sardor - avatar