From: Jason Green 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: References: <39EB742E DOT 28DBB7BB AT iprg DOT nokia DOT com> NNTP-Posting-Host: modem-75.adderall.dialup.pol.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 wrote: > My problem is as follows: > > Using DJGPP 2.03, I #include to make use of the string class in > C++. Unfortunately, setw() of the 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 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.