<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[std::string to double]]></title><description><![CDATA[<p>Hallo.<br />
Ich hab einen std::string in dieser Form: 2.45 und moechte das als double. Doch wenn ich einen istringstream nutze, macht der den Punkt einfach weg und ich erhalte 245 als double-Wert...<br />
Gibts einen anderen Loesungsvorschlag?</p>
<p>Gruss<br />
Cartman</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/234364/std-string-to-double</link><generator>RSS for Node</generator><lastBuildDate>Thu, 24 Sep 2026 11:00:44 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/234364.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 16 Feb 2009 23:19:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to std::string to double on Mon, 16 Feb 2009 23:19:38 GMT]]></title><description><![CDATA[<p>Hallo.<br />
Ich hab einen std::string in dieser Form: 2.45 und moechte das als double. Doch wenn ich einen istringstream nutze, macht der den Punkt einfach weg und ich erhalte 245 als double-Wert...<br />
Gibts einen anderen Loesungsvorschlag?</p>
<p>Gruss<br />
Cartman</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1665030</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1665030</guid><dc:creator><![CDATA[Eric Cartman]]></dc:creator><pubDate>Mon, 16 Feb 2009 23:19:38 GMT</pubDate></item><item><title><![CDATA[Reply to std::string to double on Tue, 17 Feb 2009 01:08:21 GMT]]></title><description><![CDATA[<p>Output fetched:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;sstream&gt;
using namespace std;

int main()
{
	istringstream asString(&quot;2.45&quot;);

	double asDouble;
	asString &gt;&gt; asDouble;

	cout &lt;&lt; asDouble &lt;&lt; endl; // Output: 2.45
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1665051</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1665051</guid><dc:creator><![CDATA[brain.exe]]></dc:creator><pubDate>Tue, 17 Feb 2009 01:08:21 GMT</pubDate></item><item><title><![CDATA[Reply to std::string to double on Tue, 17 Feb 2009 06:06:12 GMT]]></title><description><![CDATA[<p>boost::lexical_cast&lt;double&gt;(mystring)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1665067</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1665067</guid><dc:creator><![CDATA[anonymous222]]></dc:creator><pubDate>Tue, 17 Feb 2009 06:06:12 GMT</pubDate></item><item><title><![CDATA[Reply to std::string to double on Tue, 17 Feb 2009 08:39:55 GMT]]></title><description><![CDATA[<p>Zeig doch mal bitte den Code, der dies fabriziert...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1665101</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1665101</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Tue, 17 Feb 2009 08:39:55 GMT</pubDate></item><item><title><![CDATA[Reply to std::string to double on Tue, 17 Feb 2009 09:05:07 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">std::istringstream input1, input2;
double in1, in2;					// fuer die istreams

// viel Code

{	// irgendwo in verschachtelten for-Schleifen und if-Anweisungen
	input1.clear(); input2.clear();
	input1.str(Zahlen[i]);
	input1 &gt;&gt; in1;
	input2.str(Zahlen[i+1]);
	input2 &gt;&gt; in2;

	erg = in1 + in2;	// erg is vom Typ double
	std::ostringstream output;
	output &lt;&lt; erg;
	Ergebnis = output.str();	// Ergebnis ist ein std::string;
}
</code></pre>
<p>Hier mal das wichtigste, da es sich um sehr umfangreichen Code handelt. Aber ich glaube hier steckt der Wurm drin...</p>
<p>Gruss<br />
Cartman</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1665114</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1665114</guid><dc:creator><![CDATA[Eric Cartman]]></dc:creator><pubDate>Tue, 17 Feb 2009 09:05:07 GMT</pubDate></item><item><title><![CDATA[Reply to std::string to double on Tue, 17 Feb 2009 10:01:35 GMT]]></title><description><![CDATA[<p>Hast du zufälligerweise einen deutschen locale eingestellt? Dann würde ja der Punkt als Tausendertrenner interpretiert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1665165</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1665165</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Tue, 17 Feb 2009 10:01:35 GMT</pubDate></item><item><title><![CDATA[Reply to std::string to double on Tue, 17 Feb 2009 14:53:20 GMT]]></title><description><![CDATA[<p>Dafür gibt es die Standardfunktion atof!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1665316</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1665316</guid><dc:creator><![CDATA[berniebutt]]></dc:creator><pubDate>Tue, 17 Feb 2009 14:53:20 GMT</pubDate></item><item><title><![CDATA[Reply to std::string to double on Tue, 17 Feb 2009 15:55:42 GMT]]></title><description><![CDATA[<p>berniebutt schrieb:</p>
<blockquote>
<p>Dafür gibt es die Standardfunktion atof!</p>
</blockquote>
<p>...die aus der C-Stdlib kommt. C++ bietet bessere Möglichkeiten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1665362</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1665362</guid><dc:creator><![CDATA[The-Kenny]]></dc:creator><pubDate>Tue, 17 Feb 2009 15:55:42 GMT</pubDate></item><item><title><![CDATA[Reply to std::string to double on Tue, 17 Feb 2009 19:16:19 GMT]]></title><description><![CDATA[<p>Hallo.<br />
Sorry, der Wurm steckte woanders drin und nicht in der Konvertierung. Trotzdem danke fuer eure Muehe <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Gruss<br />
Cartman</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1665452</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1665452</guid><dc:creator><![CDATA[Eric Cartman]]></dc:creator><pubDate>Tue, 17 Feb 2009 19:16:19 GMT</pubDate></item></channel></rss>