|
From: James G. <Jam...@Cl...> - 2000-12-07 13:47:26
|
Do you mean a string as in std::string or a string as in char[] or char*?
The function to do the latter is c_str().
Regards,
James.
-----Original Message-----
From: Gregor Peter [mailto:Gre...@dl...]
Sent: Thursday, December 07, 2000 1:27 PM
To: dev...@li...; ho...@ho...
Subject: Re: [Dev-C++] int to string
OK I got the library and tried it out, but ist doesn't work.
I need to feed needsStringFunc( string name )
so I tried
string name = buffer.str()
which causes my Programm to crash :-(
So the str() method doesn't return the content of buffer as a string?!?
Gregor
Chad Simmons wrote:
> How about this instead..
>
> string my1String = "John";
> string my2String = "apples";
> int myInt = 6;
> strstream buffer;
>
> buffer << my1String << " has " << myInt << " "<< my2String << "!" << endl;
>
> cout << buffer.str();
>
> // Output = John has 6 apples!
>
> Chad Simmons
>
____________________________________________________________________________
_________
> Get more from the Web. FREE MSN Explorer download :
http://explorer.msn.com
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/mailman/listinfo/dev-cpp-users
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
http://lists.sourceforge.net/mailman/listinfo/dev-cpp-users
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
This electronic message and any attachment is intended to be
read by the named addressee(s) only.
Any other recipient should be aware that its contents may be
legally privileged and/or confidential and that its use,
disclosure, copying or distribution may be unlawful.
Unless you are a named addressee, please delete this message
Whilst C. & J. Clark International Limited has taken steps
to prevent the transmission of computer viruses with electronic mail,
responsibility for screening incoming messages and the risk of such
transmission and its consequences lies with the recipient.
C. & J. Clark International Limited
Registered in England and Wales
Company No. 141015
Registered Office: 40 High Street, Street, Somerset BA16 0YA
Telephone: +44 (0) 1458 443131
Fax: +44 (0) 1458 447547
|