Why in the 2nd part there are double backslash | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Why in the 2nd part there are double backslash

Enter something please: This is what\nthe user enters! 'This is what\\nthe user enters!'

22nd Dec 2019, 3:41 AM
Sonu
Sonu - avatar
1 Resposta
+ 2
People generally do it to print "\n" to the screen. "\\" is an escape sequence that returns a single backslash.
22nd Dec 2019, 4:11 AM
Avinesh
Avinesh - avatar