<?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::runtime_error augabe macht probleme]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe sowas:</p>
<pre><code class="language-cpp">//irgendwo in einer funktion
try{
       function();
}
catch (std::runtime_error&amp; ex) 
		{					

			std::cerr &lt;&lt; ex.what() &lt;&lt; std::endl;
		}

//in function()
void Class::function()
{
      int a = 9;
      if(//irgendeine bedingung)
            throw std::runtime_error(std::cout &lt;&lt; &quot;hallo hier ist: &quot; &lt;&lt; a &lt;&lt; std::endl;);
}
</code></pre>
<p>so gehts bei mir nicht.<br />
Bbis jetzt versuche ich es so aber so will es auch nicht:</p>
<pre><code class="language-cpp">throw std::runtime_error(&quot;hallo hier ist: &quot; + std::string(a));
</code></pre>
<p>So schaffe ich es aber auch nicht - kann mir jemand helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/193787/std-runtime_error-augabe-macht-probleme</link><generator>RSS for Node</generator><lastBuildDate>Mon, 28 Sep 2026 05:13:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/193787.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 29 Sep 2007 20:36:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to std::runtime_error augabe macht probleme on Sat, 29 Sep 2007 20:36:38 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe sowas:</p>
<pre><code class="language-cpp">//irgendwo in einer funktion
try{
       function();
}
catch (std::runtime_error&amp; ex) 
		{					

			std::cerr &lt;&lt; ex.what() &lt;&lt; std::endl;
		}

//in function()
void Class::function()
{
      int a = 9;
      if(//irgendeine bedingung)
            throw std::runtime_error(std::cout &lt;&lt; &quot;hallo hier ist: &quot; &lt;&lt; a &lt;&lt; std::endl;);
}
</code></pre>
<p>so gehts bei mir nicht.<br />
Bbis jetzt versuche ich es so aber so will es auch nicht:</p>
<pre><code class="language-cpp">throw std::runtime_error(&quot;hallo hier ist: &quot; + std::string(a));
</code></pre>
<p>So schaffe ich es aber auch nicht - kann mir jemand helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1375068</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375068</guid><dc:creator><![CDATA[umbrol]]></dc:creator><pubDate>Sat, 29 Sep 2007 20:36:38 GMT</pubDate></item><item><title><![CDATA[Reply to std::runtime_error augabe macht probleme on Sat, 29 Sep 2007 20:51:29 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">std::stringstream s;
s &lt;&lt; i;
throw std::runtime_error(&quot;Blubb bla &quot; + s.str());
</code></pre>
<p>boost::lexical_cast wäre eine alternative.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1375072</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375072</guid><dc:creator><![CDATA[The-Kenny]]></dc:creator><pubDate>Sat, 29 Sep 2007 20:51:29 GMT</pubDate></item><item><title><![CDATA[Reply to std::runtime_error augabe macht probleme on Sat, 29 Sep 2007 22:00:35 GMT]]></title><description><![CDATA[<p>Edit: Hab selten solchen Blödsinn geschrieben, besser löschen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Grüße,</p>
<p>Martin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1375100</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375100</guid><dc:creator><![CDATA[JimmydaMage]]></dc:creator><pubDate>Sat, 29 Sep 2007 22:00:35 GMT</pubDate></item></channel></rss>