delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/12/07:47:19

From: Bojan Resnik <resnikb AT eunet DOT yu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: left adjustment with iomanip
Date: Wed, 12 Apr 2000 12:26:28 +0200
Organization: Public news server of EUnet Yugoslavia
Lines: 25
Message-ID: <gUn0OKR93hpcV2vSqBLHrpSnNZoY@4ax.com>
References: <8cvctg$nj1$1 AT news DOT lth DOT se>
NNTP-Posting-Host: p-2.87.eunet.yu
Mime-Version: 1.0
X-Trace: SOLAIR2.EUnet.yu 955535404 2817 213.240.2.87 (12 Apr 2000 10:30:04 GMT)
X-Complaints-To: abuse AT EUnet DOT yu
NNTP-Posting-Date: 12 Apr 2000 10:30:04 GMT
X-Newsreader: Forte Agent 1.6/32.525
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Niklas Pettersson" <npedt97@(nospam)student.vxu.se> wrote:

>Hello!
>
>How can I can text left adjusted in Standard C++ way?
>
>ex
>
>cout << setw(50) << "Hello World";
>
>will work but print things right adjusted, maybe
>
>cout << left << setw(50) << "Hello world";
>
>but DJGPP won't let this pass...
>
>/ Niklas
>
>
>

   There is no 'left' manipulator, but there is one which allows you to set
the flags of the stream. It's 'setiosflags':

   cout << setiosflags(ios::left) << setw(50) << "Hello world";

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019