+ 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