0

\n

Hello. I have a question about using "\n". When i want put "\n" in code: cout <<a<<\n;- displays error

21st Jan 2019, 2:43 PM
Александр Могилёвский
3 Respostas
+ 3
It's a character, put double-quotes around it. Or use endl instead. cout <<a<<"\n"; cout <<a<<endl; cout <<"This will be printed\non two different lines";
21st Jan 2019, 3:01 PM
Zen
Zen - avatar
0
Thanks
21st Jan 2019, 3:02 PM
Александр Могилёвский
0
Beside Zen Zesaid, you can "wrap" \n inside a couple of single-quote if its valued like single char
21st Jan 2019, 3:14 PM
KrOW
KrOW - avatar