سؤال

So I need to print a title using \ __ ||

it will become something like this

  ______
 |_   _ \
   | |_) |
   |  __'.
  _| |__) |
 |_______/

how to print all, and i get error even though i use \ to print \

هل كانت مفيدة؟

المحلول 2

I'm able to print out your image with this code:

char* thing = "  ______\r\n |_   _ \\\r\n   | |_) |\r\n   |  __'.\r\n  _| |__) |\r\n |_______/";

int main( void )
{
    printf("%s",thing);
    return 0;
}

What you need is a string escaping tool, if you plan on escaping complex images. I used one at http://www.freeformatter.com/java-dotnet-escape.html#ad-output

نصائح أخرى

To print \ you need to put \\ in your string, because \ is an escape (e.g. \n for a new line).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top