+ 1
Why not able to print \ using this line of code
cout<< hello<< \ n << world; output is hello n world
5 Answers
+ 2
learn escape character
https://en.cppreference.com/w/cpp/language/escape
code:
https://code.sololearn.com/ck5yXhiaGbW8/?ref=app
+ 1
how to use ASCII value
+ 1
code is modify how to use
ASCII value:
https://code.sololearn.com/ck5yXhiaGbW8/?ref=app
0
cout<< "hello\"world\"";
0
\ is a weird thing.
\n is used as next line so
cout<<"hi\nbro<<;
would be
hi
bro
when you do a \ it exspects a letter after that so
if there is no letter it errors out
your code
cout<< hello<< \ n << world;
output is hello n world
you have \ n it should be \n
no space