delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/10/17/16:00:29

From: Jason Green <news AT jgreen4 DOT fsnet DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Problems with strings while using djgpp
Date: Tue, 17 Oct 2000 20:55:09 +0100
Organization: Customer of Energis Squared
Lines: 23
Message-ID: <v0bpusc72mlpao90a7j3cjajp2mhv8hrrc@4ax.com>
References: <39EB742E DOT 28DBB7BB AT iprg DOT nokia DOT com>
NNTP-Posting-Host: modem-75.adderall.dialup.pol.co.uk
Mime-Version: 1.0
X-Trace: news5.svr.pol.co.uk 971812589 28879 62.136.76.75 (17 Oct 2000 19:56:29 GMT)
NNTP-Posting-Date: 17 Oct 2000 19:56:29 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Newsreader: Forte Agent 1.7/32.534
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eric Nute <nute AT iprg DOT nokia DOT com> wrote:

> My problem is as follows:
> 
> Using DJGPP 2.03, I #include <string> to make use of the string class in
> C++.  Unfortunately, setw() of the <iomanip> file does not seem to work
> on objects of class string.  My instructor suggested using the syntax,
> given a string string = "test"; , of &string[0] in order to use the
> setw() function with the object.  Unfortunately, this resulted in a
> bunch of garbage following the value of string.
> 
> My question is how can I use setw() with an object of class string? 
> Alternatively, is there another way in which I manipulate the columns of
> my final output if I am using an object of class string? 

Not all of <iomanip> is implemented, but I believe setw() does work.

Can you post a small program that demonstrates how setw() is not
working for you?  Together with the compile command you use and any
error messages.

Please say what you think the code should do, and tell us what it
actually does.

- Raw text -


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