0

How to print " in printf("something equal "x(as char)" ") ??

abelenky
  • 63,815
  • 23
  • 109
  • 159
  • 2
    I 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
  • 2
    This is basic C course stuff. A standard subject in the *strings* topic. – Cheatah Nov 02 '22 at 22:39

1 Answers1

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