|
From: James G. <Jam...@Cl...> - 2000-12-07 12:01:36
|
strstream is part of the C++ IO Streams. I believe it's in strstream. It's in dev-C++\include\G++, all it does it include strstream.h. Regards, James. -----Original Message----- From: Gregor Peter [mailto:Gre...@dl...] Sent: Thursday, December 07, 2000 11:20 AM To: dev...@li...; ho...@ho... Subject: Re: [Dev-C++] int to string Fine, but where to get strstream from? It isn't in iostream.h am I right? Are there any online documentation about stdlib.h, string.h & Co where I can browse for myself? Gregor Chad Simmons wrote: > >How to convert, cast, transform, whatever a int value to a string? > >include <string.h> > >string my1String = "John has"; string my2String = "apples!"; int myInt = 6; > >my1stString = my1stString + UNKNOWN_FUNC(myInt) + my2ndString; > >As you guessed I'd like to get: "John has 6 apples!" > > 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! _______________________________________________ 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 |