nested printf

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • soorajk007@gmail.com

    nested printf

    Hi friends,

    Can u plz tell me why
    printf("%d",pri ntf(" Hello World "));
    prints Hello World13.
    Please explain the concept in detail.

    Thanks
    Sooraj

  • Bill Pursell

    #2
    Re: nested printf


    soorajk...@gmai l.com wrote:[color=blue]
    > Hi friends,
    >
    > Can u plz tell me why
    > printf("%d",pri ntf(" Hello World "));
    > prints Hello World13.
    > Please explain the concept in detail.[/color]
    [color=blue]
    >From the man page for printf:[/color]
    Upon successful return, these functions return the number of
    characters printed ...

    The inner printf printf " Hello World " and returns the number of
    characters printed, namely 13. The outer printf then prints "13".

    Comment

    • void * clvrmnky()

      #3
      Re: nested printf

      soorajk007@gmai l.com wrote:[color=blue]
      > Can u plz tell me why
      > printf("%d",pri ntf(" Hello World "));
      > prints Hello World13.
      > Please explain the concept in detail.
      >[/color]
      Didn't someone asked this very question in this newsgroup recently? I
      recall because I had never seen this construct before, though the answer
      did not surprise me in the least.

      Comment

      • SM Ryan

        #4
        Re: nested printf

        soorajk007@gmai l.com wrote:
        # Hi friends,
        #
        # Can u plz tell me why
        # printf("%d",pri ntf(" Hello World "));
        # prints Hello World13.
        # Please explain the concept in detail.

        Lisp serialisation.

        --
        SM Ryan http://www.rawbw.com/~wyrmwif/
        She broke your heart and inadvertently drove men to deviant lifestyles.

        Comment

        Working...