CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: setw related

Threaded View

  1. #1
    Join Date
    May 2015
    Posts
    540

    setw related

    I am trying to output some info and in the legacy code, they used setw. I am trying to match that..

    Code:
            std::ostringstream os;
    
            os << "Name    QualityIndicator       MaxUlBitRate           MaxDlBitRate            nGuarUlBitRate          nGuarDlBitRate" << std::endl;
    
    		for (; itr != end; ++itr)
    		{
    			Data = *p_itr;
    
    			os << p_itr.sName << setw(11) << p_itr.nQualityIndicator << setw(30) << p_itr.nMaxUlBitRate
    					   << setw(53) << p_itr.nMaxDlBitRate << setw(78) << p_itr.nGuarUlBitRate
    					   << setw(102) << p_itr.nGuarDlBitRate << endl;
    		}
    Is there any suggestions to make this better..I somehow feel setw is not the choice, but may be the legacy code chose this for some reason..May be because i am not a c++ expert, not able to see it.

    thanks a lot
    ~p
    Last edited by pdk5; November 8th, 2015 at 05:52 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured