int to string conversion

Thomas Matelich tmatelich at zetec.com
Sun Feb 13 04:22:21 GMT 2000


Tobias Erbsland wrote:

> Only a hint: Don't use the "strstream" class of the gcc package. You will
> get strange errors. But this class should be the solution of your problem:
>
> int x = 23878979;
> strstram newnumber;
>
> newnumber << x;
>
> string test = "the new number is: " + newnumber.str();

The only problem I have had with gcc's strstream was that it required you to
write:

newnumber << x << ends;

This is not a c++ standard requirement, but my impression is that even once it is
not necessary, it won't hurt, so I use it.

--
Thomas O Matelich
Senior Software Designer
Zetec, Inc.
sosedada at usa.net
tmatelich at zetec.com







More information about the KDevelop mailing list