Menu

Win32 "tcpstream" and "endl" line termination

Help
2000-12-27
2001-01-03
  • Gary Bartlett

    Gary Bartlett - 2000-12-27

    When I use

      cout << "123" << endl << "456" << endl;

    my output window shows:

      123
      456

    as expected.  However, when I use a tcpstream object (e.g. tout) which has been connected to from a local client:

      tout << "123" << endl << "456" << endl;

    my output window shows:

      123
         456

    Any idea how to tell the tcpstream to use '\r\n' instead of '\n' for its endl?  Or is there another way to achieve this?

    Thanks,
    Gary

     
    • David Sugar

      David Sugar - 2001-01-03

      There actually is a "crlf" stream manipulator which does as one might guess, add a crlf pair to a stream.  You should be able to use this in place of endl.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.