<?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[stringstream problem]]></title><description><![CDATA[<p>hola leute</p>
<p>hab in einem stringstream folgenden string:</p>
<pre><code>913,176	1100,000    913,176    1100,000 ...
</code></pre>
<p>sind alles double werte.<br />
wenn ich nun die werte in ein double array laden will, das kommt nur der erste<br />
werte 'ohne' nachkommastellen an. beim 2ten wert hat der stream schon das fail bit gesetzt. woran kann das liegen ?</p>
<p>Meep Meep</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/165314/stringstream-problem</link><generator>RSS for Node</generator><lastBuildDate>Mon, 14 Sep 2026 11:27:39 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/165314.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 18 Nov 2006 16:03:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to stringstream problem on Sat, 18 Nov 2006 16:03:08 GMT]]></title><description><![CDATA[<p>hola leute</p>
<p>hab in einem stringstream folgenden string:</p>
<pre><code>913,176	1100,000    913,176    1100,000 ...
</code></pre>
<p>sind alles double werte.<br />
wenn ich nun die werte in ein double array laden will, das kommt nur der erste<br />
werte 'ohne' nachkommastellen an. beim 2ten wert hat der stream schon das fail bit gesetzt. woran kann das liegen ?</p>
<p>Meep Meep</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1176675</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1176675</guid><dc:creator><![CDATA[Meep Meep]]></dc:creator><pubDate>Sat, 18 Nov 2006 16:03:08 GMT</pubDate></item><item><title><![CDATA[Reply to stringstream problem on Sat, 18 Nov 2006 16:09:35 GMT]]></title><description><![CDATA[<p>Hast locale nicht richtig gesetzt. So funktioniert das einlesen nur mit Punkt als Trennzeichen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1176679</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1176679</guid><dc:creator><![CDATA[Thomas ** 0]]></dc:creator><pubDate>Sat, 18 Nov 2006 16:09:35 GMT</pubDate></item><item><title><![CDATA[Reply to stringstream problem on Sat, 18 Nov 2006 16:12:42 GMT]]></title><description><![CDATA[<p>re</p>
<p>und in welcher datei muss ich das aendern, das ich das problem nicht wieder bekomme ?<br />
in den inludes vom BCB6 hab ich insgesammt 9 dateien die locale.* heissen.</p>
<p>Meep Meep</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1176683</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1176683</guid><dc:creator><![CDATA[Meep Meep]]></dc:creator><pubDate>Sat, 18 Nov 2006 16:12:42 GMT</pubDate></item><item><title><![CDATA[Reply to stringstream problem on Sat, 18 Nov 2006 16:42:42 GMT]]></title><description><![CDATA[<p>&lt;locale&gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1176706</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1176706</guid><dc:creator><![CDATA[Cpt.Tanga]]></dc:creator><pubDate>Sat, 18 Nov 2006 16:42:42 GMT</pubDate></item><item><title><![CDATA[Reply to stringstream problem on Sat, 18 Nov 2006 16:54:51 GMT]]></title><description><![CDATA[<p>Cpt.Tanga schrieb:</p>
<blockquote>
<p>&lt;locale&gt;</p>
</blockquote>
<p>kann zu mindest beim BCB nichts stimmen. da finde ich keinen beistrich in der datei, den ich gegen einen punkt austauschen koennte.</p>
<p>Meep Meep</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1176714</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1176714</guid><dc:creator><![CDATA[Meep Meep]]></dc:creator><pubDate>Sat, 18 Nov 2006 16:54:51 GMT</pubDate></item><item><title><![CDATA[Reply to stringstream problem on Sat, 18 Nov 2006 17:41:36 GMT]]></title><description><![CDATA[<p>Wenn das eine Benutzereingabe ist wuerde ich es an die jeweilige Umgebung anpassen:</p>
<pre><code class="language-cpp">#include &lt;sstream&gt;
#include &lt;iostream&gt;
#include &lt;locale&gt;

int main(int argc, char **argv) {

    if(argc &lt;= 1) return 1;

    std::istringstream stream(argv[1]);
    std::locale env = std::locale(&quot;&quot;);
    stream.imbue(env);

    double a;
    stream &gt;&gt; a;

    std::cout &lt;&lt; env.name() &lt;&lt; &quot;: &quot; &lt;&lt; a &lt;&lt; std::endl;
}
</code></pre>
<p>Versuch das mal und sag was raus kommt, weis gar nicht ob das unter Windows funktioniert. Mein Linux zeigt mir das:<br />
$ ./locale 1.23<br />
en_US.UTF-8: 1.23<br />
bzw wenn ich umstell:<br />
$ ./locale 1,23<br />
de_DE.UTF-8: 1.23</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1176739</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1176739</guid><dc:creator><![CDATA[Thomas ** 0]]></dc:creator><pubDate>Sat, 18 Nov 2006 17:41:36 GMT</pubDate></item><item><title><![CDATA[Reply to stringstream problem on Sat, 18 Nov 2006 17:42:17 GMT]]></title><description><![CDATA[<p>Meep Meep schrieb:</p>
<blockquote>
<p>Cpt.Tanga schrieb:</p>
<blockquote>
<p>&lt;locale&gt;</p>
</blockquote>
<p>kann zu mindest beim BCB nichts stimmen. da finde ich keinen beistrich in der datei, den ich gegen einen punkt austauschen koennte.</p>
<p>Meep Meep</p>
</blockquote>
<p>nicht austauschen! die locales sind die regionsspezifischen stream einstellungen. In der doku der locales steht, wie du das einstellen kannst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1176741</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1176741</guid><dc:creator><![CDATA[otze]]></dc:creator><pubDate>Sat, 18 Nov 2006 17:42:17 GMT</pubDate></item><item><title><![CDATA[Reply to stringstream problem on Sat, 18 Nov 2006 17:56:00 GMT]]></title><description><![CDATA[<p>otze schrieb:</p>
<blockquote>
<p>Meep Meep schrieb:</p>
<blockquote>
<p>Cpt.Tanga schrieb:</p>
<blockquote>
<p>&lt;locale&gt;</p>
</blockquote>
<p>kann zu mindest beim BCB nichts stimmen. da finde ich keinen beistrich in der datei, den ich gegen einen punkt austauschen koennte.</p>
<p>Meep Meep</p>
</blockquote>
<p>nicht austauschen! die locales sind die regionsspezifischen stream einstellungen. In der doku der locales steht, wie du das einstellen kannst.</p>
</blockquote>
<p>und wo finde ich dir doku zu dem zeugs ? hab davon noch nie was gesehen.</p>
<p>Meep Meep</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1176746</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1176746</guid><dc:creator><![CDATA[Meep Meep]]></dc:creator><pubDate>Sat, 18 Nov 2006 17:56:00 GMT</pubDate></item><item><title><![CDATA[Reply to stringstream problem on Sat, 18 Nov 2006 18:07:20 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/9591">@Thomas</a> (:</p>
<p>ja des hat funktioniert. aber was soll der/die/das locale ueberhaupt sein? ich hab darueber bis jetzt noch in keinem buch was gelesen.<br />
waere es nicht einfacher und besser, wenn es dafuer ne globale variable oder so gaebe wo man den ',' gegen einen '.' austauschen kann? ich seh da jetzt ehrlich gesagt keinen sinn in dem zeug.</p>
<p>kennt vielleicht jemand ne seite wo locales beschrieben sind?</p>
<p>Meep Meep</p>
<p>PS: auf deutsch waere is am besten. sonst brauch ich wieder ne woche bis ich ueberhaupt den text verstehe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1176755</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1176755</guid><dc:creator><![CDATA[Meep Meep]]></dc:creator><pubDate>Sat, 18 Nov 2006 18:07:20 GMT</pubDate></item><item><title><![CDATA[Reply to stringstream problem on Sat, 18 Nov 2006 18:21:47 GMT]]></title><description><![CDATA[<p>Meep Meep schrieb:</p>
<blockquote>
<p>ja des hat funktioniert. aber was soll der/die/das locale ueberhaupt sein? ich hab darueber bis jetzt noch in keinem buch was gelesen.<br />
waere es nicht einfacher und besser, wenn es dafuer ne globale variable oder so gaebe wo man den ',' gegen einen '.' austauschen kann? ich seh da jetzt ehrlich gesagt keinen sinn in dem zeug.</p>
</blockquote>
<p>Es geht hier nicht um einen Punkt! die locales enthalten alle regionsspezifischen einstellungen, zb für uhrzeit, datumsangaben usw.</p>
<p>hier mal ein englisches tutorial(deutsch findest zu dem thema quasi garnichts), das dir zeigt, wozu locales dienen, und was man damit machen kann.</p>
<p><a href="http://www.cantrip.org/locale.html" rel="nofollow">http://www.cantrip.org/locale.html</a></p>
<p>das einfachste wird aber wohl erstmal sein, den string durchzugehen und alle &quot;,&quot; durch &quot;.&quot; zu ersetzen.</p>
<p>Ps: mit</p>
<pre><code class="language-cpp">std::locale env = std::locale(&quot;&quot;);
stream.imbue(env);
</code></pre>
<p>hat Thomas (: versucht, das &quot;standard&quot; locale für dein system zu laden. In deinem Fall mit einem deutschen Windows/linux ist das meistens ein deutsches locale(dies muss aber nicht sein!).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1176765</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1176765</guid><dc:creator><![CDATA[otze]]></dc:creator><pubDate>Sat, 18 Nov 2006 18:21:47 GMT</pubDate></item><item><title><![CDATA[Reply to stringstream problem on Sat, 18 Nov 2006 19:17:09 GMT]]></title><description><![CDATA[<p>Gibt auch ein (sehr gutes) Buch über die Streams:</p>
<p><a href="https://duckduckgo.com/?q=isbn+0201183951&amp;cppnetbooks" rel="nofollow">Standard C++ IOStreams and Locales | ISBN: 0201183951</a></p>
<p>Habe es selbst und kann es wirklich jedem empfehlen der sich für die streams interressiert. Es wird sowohl die Benutzung, Erweiterung als auch die Implementierung behandelt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1176790</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1176790</guid><dc:creator><![CDATA[lolz]]></dc:creator><pubDate>Sat, 18 Nov 2006 19:17:09 GMT</pubDate></item></channel></rss>