How to print " in printf("something equal "x(as char)" ") ??
Asked
Active
Viewed 33 times
0
abelenky
- 63,815
- 23
- 109
- 159
Олександр Бойко
- 3
- 1
-
2I don't understand much of this question I must say. `puts("\" in printf(\"something equal \"x(as char)\" \")");` would print `" in printf("something equal "x(as char)" ")` but I assume that's not what you actually want. Can you please elaborate? – Ted Lyngmo Nov 02 '22 at 22:33
-
2This is basic C course stuff. A standard subject in the *strings* topic. – Cheatah Nov 02 '22 at 22:39
1 Answers
1
#include <stdio.h>
int main(void) {
printf("something equal \"x(as char)\" ");
return 0;
}
In C, the escape character is \.
So to print a literal ", instead of using it to end a string, use \".
abelenky
- 63,815
- 23
- 109
- 159