Home > Blockchain >  How can i output "\" in console. C
How can i output "\" in console. C

Time:11-12

I want to white some symbols in console but i have troubles with output of character " \ " I know it is reservated by C for formatting inside printf but i really want to output it. Srry for bad english, it is not my mother tongue.

printf(" __    __  __ __  ____    \n");
printf(" ||\  /||  || //  ||/\\   \n");
printf(" ||\\//||  ||//   ||\//  \n");
printf(" || \/ ||  ||\\   ||‾‾   \n");
printf(" ||    ||  || \\  ||   \n");
printf(" ‾‾       

i expect that \ in this will just output like any other char but it cant just output

CodePudding user response:

Backspace is a special escape character in C/C , so that you can type, e.g., '\n'. You can use \\ to have a \ in your string.

CodePudding user response:

escape it - for example

 printf(" ||    ||  || \\  ||   \n");

shpuld be

  printf(" ||    ||  || \\\\  ||   \n");
  • Related