Why this statement does not execute?

The statement
printf("""); does not execute. Can anybody tell me why? plz

Comments

  • : The statement
    : printf("""); does not execute. Can anybody tell me why? plz
    :
    :
    That statement should not compile.

    C and C++ uses the " operators to mark the beginning and end of the string. As such, your statement becomes:
    [code]
    printf([red] " "[/red] ");
    [/code]
    Notice what is happening here. The last part of this expression ([red]");[/red]) has no meaning.

    To print out a " character, without terminating the string, you need to use a character constant, such as /n, /0, or /"...
    [code]
    printf(" /" "); // prints quotation marks "
    [/code]
    [hr][size=1][leftbr].:EvolutionEngine[rightbr][leftbr].:MicroOS Operating System[rightbr][leftbr][link=http://www.mt2002.sitesled.com]Website :: OS Development Series[rightbr][/link][/size]
  • : To print out a " character, without terminating the string, you need
    : to use a character constant, such as /n, /0, or /"...

    Or rather
    ". Backslash.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories