[lug] C++ libraries in Linux

Keith C. Herold herold at cslr.Colorado.EDU
Tue Sep 18 08:53:01 MDT 2001


Yeah, I had sort of hoped there was something that didn't involve creating
an entire stream just to push one integer or double out.  Why aren't there
constructor versions for the primitive datatypes in string?

--Keith

> -----Original Message-----
> From: lug-admin at lug.boulder.co.us [mailto:lug-admin at lug.boulder.co.us]On
> Behalf Of Scott A. Herod
> Sent: Tuesday, September 18, 2001 8:11 AM
> To: lug at lug.boulder.co.us
> Subject: RE: [lug] C++ libraries in Linux
>
>
> Hi,
>   I use something like the following:
>
> #include
> <strstream>
> string paraNode::toString()
> {
>     string rtnval;
>     strstream buf;
>
>     buf << "Paragraph: "
>         << ATTR_ALIGN << " = " << _align << ", "
>         << ATTR_WRAP_MODE << " = " << _mode
>         << ends;
>
>     rtnval = buf.str();
>     return rtnval;
> }
>
>
> > Can it be true?  There are no converters to go from an int to a
> string?  Or
> > a double to a string?
> >
> > --Keith
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
>




More information about the LUG mailing list