This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: output formatting: setw & setiosflags


On Mon, Jul 07, 2003 at 11:19:27AM -0400, Justin Miller wrote:
> Is there an alternate to using setw and setiosflags since they don't
> appear to be present in gnu gcc?

What makes you think that? Does this mean the following code doesn't
compile on your system? What's the problem?

//// 

#include <ios>
#include <iomanip>
#include <iostream>

int main()
{
  std::cout << std::setiosflags (std::ios::showbase | std::ios::showpos)
	    << std::setw (10) << 12345 << std::endl;
}

////

-- 
Claudio Bley                                 ASCII ribbon campaign (")
Debian GNU/Linux user                         - against HTML email  X 
http://www.cs.uni-magdeburg.de/~bley/                     & vCards / \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]