I am trying to add the \ in C with:
sprintf("trying to add \ in this print");
I have tried to lookup and find this and I cannot seem to get it to work.
Asked
Active
Viewed 64 times
1 Answers
1
Have you tried the double backslash: sprintf("trying to add \\ in this print");
?

Bernardo Duarte
- 4,074
- 4
- 19
- 34
-
I didn't try it no, I went to go and try it and it worked. Thank you very much. – Nocturnal Feb 19 '21 at 06:17
-
@Nocturnal Look up a list of all the escape characters, because it seems like you don't know them all yet. https://en.wikipedia.org/wiki/Escape_sequences_in_C This should be useful – mediocrevegetable1 Feb 19 '21 at 06:22
-
1But preferably from a real documentation site like https://en.cppreference.com/w/c/language/escape – costaparas Feb 19 '21 at 06:25