Re: Predictably formated output with std::cout?

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

    Re: Predictably formated output with std::cout?

    On Jul 7, 6:21 pm, r...@zedat.fu-berlin.de (Stefan Ram) wrote:
      Possibly, you can create a new ostream object associated with
      stdout and then use this with custom settings instead of cout.
    That is as simple as -

    std::ostream out(std::cout.r dbuf());

    out << "state free formatted output";

    Kind regards,
    Vladimir
  • Carsten Fuchs

    #2
    Re: Predictably formated output with std::cout?

    Hi all,

    thank you very much to everyone for your answers, they helped a lot!

    The boost stream-state saver library sounds good, but I guess that the own ostream instance as
    described by Vladimir and Ali, that is:

    vova777@gmail.c om wrote:
    std::ostream out(std::cout.r dbuf());
    out << "state free formatted output";
    is what I was looking for and fits my case best.

    Many thanks for your help!

    Best regards,
    Carsten

    Comment

    Working...