www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/10/16/17:34:50

X-Virus-Scanned: Mon, 16 Oct 2000 14:33:40 -0700 Nokia Silicon Valley Email Exploit Scanner
Message-ID: <39EB742E.28DBB7BB@iprg.nokia.com>
Date: Mon, 16 Oct 2000 14:33:34 -0700
From: Eric Nute <nute AT iprg DOT nokia DOT com>
X-Mailer: Mozilla 4.72 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Problems with strings while using djgpp
Reply-To: djgpp AT delorie DOT com

Hello,

Thank you for making DJGPP available.  I have greatly enjoyed using it
as I learn to program.  I have encountered a problem for which I could
not find any mention in the FAQ or Docs.  I realize that you are busy,
but I also would greatly appreciate an answer to this problem.

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? 
-- 
Eric JL Nute
nute AT iprg DOT nokia DOT com
650-625-2525

- Raw text -


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