<?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[Problem : Rückgabewert]]></title><description><![CDATA[<p>Hallo,</p>
<p>int funktion ( )</p>
<p>Wie ist das nochmal wenn ich eine if ..else Verzweigung verwende<br />
und z.b. nur im if- Zweig ein int Wert zurückgegeben wird,<br />
aber im else nur eine ganz normale cout&lt;&lt; Anweisung, aber kein int Wert.<br />
Wie wird das ganze dann gehandhabt. Der Compiler meckert denk ich mal<br />
nicht.</p>
<p>Bye</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/252873/problem-rückgabewert</link><generator>RSS for Node</generator><lastBuildDate>Mon, 14 Sep 2026 04:13:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/252873.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 25 Oct 2009 20:17:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem : Rückgabewert on Sun, 25 Oct 2009 20:17:01 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>int funktion ( )</p>
<p>Wie ist das nochmal wenn ich eine if ..else Verzweigung verwende<br />
und z.b. nur im if- Zweig ein int Wert zurückgegeben wird,<br />
aber im else nur eine ganz normale cout&lt;&lt; Anweisung, aber kein int Wert.<br />
Wie wird das ganze dann gehandhabt. Der Compiler meckert denk ich mal<br />
nicht.</p>
<p>Bye</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1798233</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1798233</guid><dc:creator><![CDATA[blurry33]]></dc:creator><pubDate>Sun, 25 Oct 2009 20:17:01 GMT</pubDate></item><item><title><![CDATA[Reply to Problem : Rückgabewert on Sun, 25 Oct 2009 20:22:58 GMT]]></title><description><![CDATA[<p>Aber trotzdem ist es falsch , auch wenn er nicht meckert :))</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1798237</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1798237</guid><dc:creator><![CDATA[blurry33]]></dc:creator><pubDate>Sun, 25 Oct 2009 20:22:58 GMT</pubDate></item><item><title><![CDATA[Reply to Problem : Rückgabewert on Sun, 25 Oct 2009 20:23:27 GMT]]></title><description><![CDATA[<p>Ein guter Compiler würde warnen. MSVC9 tut es z.B.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1798238</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1798238</guid><dc:creator><![CDATA[Ad aCTa]]></dc:creator><pubDate>Sun, 25 Oct 2009 20:23:27 GMT</pubDate></item><item><title><![CDATA[Reply to Problem : Rückgabewert on Sun, 25 Oct 2009 20:33:03 GMT]]></title><description><![CDATA[<p>Ja er warnt auch, aber das erstaunliche es wird immer ein Wert zurückgegeben.<br />
Auch wenn wie im Beispiel unten der else Zweig nicht abgearbeitet wird.</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;

using namespace std;

int funktion(int y)
{

	if(y&gt;5)
	{
		cout&lt;&lt;&quot;Zahl zu groß&quot;;
	}

	else
	{
	return y;
	}
}

void main (void) 

{

	int x=4;
	int z;

	z=funktion(x);

	cout&lt;&lt;z;

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1798243</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1798243</guid><dc:creator><![CDATA[blurry33]]></dc:creator><pubDate>Sun, 25 Oct 2009 20:33:03 GMT</pubDate></item><item><title><![CDATA[Reply to Problem : Rückgabewert on Sun, 25 Oct 2009 20:34:38 GMT]]></title><description><![CDATA[<p>blurry33 schrieb:</p>
<blockquote>
<p>Ja er warnt auch, aber das erstaunliche es wird immer ein Wert zurückgegeben.</p>
</blockquote>
<p>Das muss sie auch. Der Wert ist dann aber undefiniert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1798244</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1798244</guid><dc:creator><![CDATA[Registrierter Troll]]></dc:creator><pubDate>Sun, 25 Oct 2009 20:34:38 GMT</pubDate></item><item><title><![CDATA[Reply to Problem : Rückgabewert on Sun, 25 Oct 2009 20:40:41 GMT]]></title><description><![CDATA[<p>Aber wie kann ich das Problem lösen ??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1798245</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1798245</guid><dc:creator><![CDATA[blurry33]]></dc:creator><pubDate>Sun, 25 Oct 2009 20:40:41 GMT</pubDate></item><item><title><![CDATA[Reply to Problem : Rückgabewert on Sun, 25 Oct 2009 20:49:50 GMT]]></title><description><![CDATA[<p>mit einer exception oder wenns nen logikfehler ist, dann reicht vll auch nen assert...</p>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1798252</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1798252</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Sun, 25 Oct 2009 20:49:50 GMT</pubDate></item><item><title><![CDATA[Reply to Problem : Rückgabewert on Sun, 25 Oct 2009 20:53:59 GMT]]></title><description><![CDATA[<p>... oder ein Defaultwert zurückgeben, falls das in deinem Fall eine sinnvolle Option ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1798255</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1798255</guid><dc:creator><![CDATA[Nanyuki]]></dc:creator><pubDate>Sun, 25 Oct 2009 20:53:59 GMT</pubDate></item></channel></rss>