<< "\t";

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff Schwab

    #16
    Re: &lt;&lt; &quot;\t&quo t;;

    Ivan Vecerina wrote:[color=blue]
    > "Jeff Schwab" <jeffplus@comca st.net> wrote in message
    > news:S7-dnbJoKZuG2TfdRV n-ig@comcast.com. ..
    >[color=green][color=darkred]
    >>>Regarding cout, it is a bit more complicated... it is unlikely to
    >>>be buffered at the C++ level because by default it is supposed[/color][/color]
    >
    > emphasis on: ~~~~~~~~~~~~~~~ ~
    >[color=green][color=darkred]
    >>>to be synchronized with stdout. But it can still be buffered.[/color]
    >>
    >>Why would that make it unlikely to be buffered? I've never seen a
    >>situation in which cout was unbuffered.[/color]
    >
    >
    > Please read the thread I refered to in my previous post:
    > http://groups.google.com/groups?selm...nnrp1.deja.com
    >
    > Unless the program calls std::ios_base:: sync_with_stdio (false),
    > it is possible to mix calls that write to stdout and cout with
    > the guarantee of a properly synchronized output.
    > I.e: cout<<'a'; putchar('b'); cout<<'c'<<endl ;
    > Is required to output "abc" (and not "bac" or anything else).[/color]

    That doesn't make it unbuffered; in fact, it generally means that cout
    is buffered.
    [color=blue]
    > Because, on most platforms, cout is implemented in terms of stdout,
    > this means that buffering must be disabled in cout - at the C++ level.[/color]

    Not sure what you mean. If you mean that the C++ run-time library may
    not provide redundant buffering when the OS already provides a buffer
    for stdout, then OK, I'm with you.
    [color=blue]
    > An implementation-defined buffering mechanism of stdout may still
    > apply, however.[/color]

    Comment

    • Ivan Vecerina

      #17
      Re: &lt;&lt; &quot;\t&quo t;;

      "Jeff Schwab" <jeffplus@comca st.net> wrote in message
      news:XcGdnRVM8Y LM0zfd4p2dnA@co mcast.com...[color=blue]
      > Ivan Vecerina wrote:[color=green]
      > > Because, on most platforms, cout is implemented in terms of stdout,
      > > this means that buffering must be disabled in cout - at the C++ level.[/color]
      >
      > Not sure what you mean. If you mean that the C++ run-time library may
      > not provide redundant buffering when the OS already provides a buffer
      > for stdout, then OK, I'm with you.[/color]

      This is indeed what I meant by:
      Regarding cout, it is a bit more complicated... it is unlikely to
      be buffered at the C++ level because by default it is supposed
      to be synchronized with stdout. But it can still be buffered.


      Peace,
      Ivan
      --
      http://ivan.vecerina.com/contact/?subject=NG_POST <- e-mail contact form


      Comment

      Working...