Article View: be.comp.programming
Article #519Re: Converteren C++
From: Manchiu
Date: Sun, 13 May 2007 12:15
Date: Sun, 13 May 2007 12:15
33 lines
1902 bytes
1902 bytes
Gr8,
thx
"Kristoffel" <noname_nomail.nospam@yahoo.com> schreef in bericht
news:tnu1i.173280$9P1.1147006@phobos.telenet-ops.be...
> Manchiu wrote:
>> Hallo,
>>
>> hoe kan ik in C++ variabelen converteren naar een string?
>
> vb:
> #include <iostream>
> #include <sstream> // String Streams
> using namespace std;
>
> int main (void) {
> int i = 123;
> float f = 3.14;
> ostringstream oss;
> oss << "Dit is een integer > " << i << " <,";
> oss << " en dit is een float > " << f << " <";
>
> cout << oss.str() << endl;
>
> return 0;
> }
>
> geeft als output:
> Dit is een integer > 123 <, en dit is een float > 3.14 <
>
> --
> Kristoffel
Technical Details
Message-ID:
<WjD1i.173987$LS5.1232965@phobos.telenet-ops.be>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!213.132.189.1.MISMATCH!multikabel.net!feed10.multikabel.net!hwmnpeer01.ams!news.highwinds-media.com!kramikske.telenet-ops.be!nntp.telenet.be!kwabbernoot.telenet-ops.be!phobos.telenet-ops.be.POSTED!not-for-mailReferences:
<Xhm1i.172573$pj4.1197158@phobos.telenet-ops.be> <tnu1i.173280$9P1.1147006@phobos.telenet-ops.be>Show Full Headers
Complete Article Headers
X-Google-Thread: fcea4,51170fa134f521e6 X-Google-Attributes: gidfcea4,public X-Google-Language: DUTCH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!213.132.189.1.MISMATCH!multikabel.net!feed10.multikabel.net!hwmnpeer01.ams!news.highwinds-media.com!kramikske.telenet-ops.be!nntp.telenet.be!kwabbernoot.telenet-ops.be!phobos.telenet-ops.be.POSTED!not-for-mail From: "Manchiu" <manchiu@nomail.com> Newsgroups: be.comp.programming References: <Xhm1i.172573$pj4.1197158@phobos.telenet-ops.be> <tnu1i.173280$9P1.1147006@phobos.telenet-ops.be> Subject: Re: Converteren C++ Lines: 35 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 X-RFC2646: Format=Flowed; Response Message-ID: <WjD1i.173987$LS5.1232965@phobos.telenet-ops.be> Date: Sun, 13 May 2007 12:15:50 GMT NNTP-Posting-Host: 84.195.232.100 X-Complaints-To: abuse@telenet.be X-Trace: phobos.telenet-ops.be 1179058550 84.195.232.100 (Sun, 13 May 2007 14:15:50 MEST) NNTP-Posting-Date: Sun, 13 May 2007 14:15:50 MEST Organization: Telenet Internet