Mail Archives: djgpp/2000/10/17/16:00:29
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 -