<?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[Wozu else if]]></title><description><![CDATA[<p>Hi, ich hab lange drueber nachgedacht und gegoogelt. Aber ich peils einfach nicht...wozu if else?</p>
<p>Wenn man eine if bedingung stellt, und die eingabe trifft zu, dann wird sie erfuellt.<br />
Bei else if haargenau so.</p>
<p>Also wozu?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/320079/wozu-else-if</link><generator>RSS for Node</generator><lastBuildDate>Fri, 24 Jul 2026 14:50:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/320079.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 15 Sep 2013 17:43:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wozu else if on Sun, 15 Sep 2013 17:43:46 GMT]]></title><description><![CDATA[<p>Hi, ich hab lange drueber nachgedacht und gegoogelt. Aber ich peils einfach nicht...wozu if else?</p>
<p>Wenn man eine if bedingung stellt, und die eingabe trifft zu, dann wird sie erfuellt.<br />
Bei else if haargenau so.</p>
<p>Also wozu?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2352780</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2352780</guid><dc:creator><![CDATA[kamelkacke]]></dc:creator><pubDate>Sun, 15 Sep 2013 17:43:46 GMT</pubDate></item><item><title><![CDATA[Reply to Wozu else if on Sun, 15 Sep 2013 17:54:42 GMT]]></title><description><![CDATA[<p>Beispiel:</p>
<pre><code>if (foo % bar == 0) // Wenn foo teilbar durch bar
	...
if (foo == 5) // wenn foo gleich 5
	...
else // wenn foo nicht 5
	...
</code></pre>
<p>vs</p>
<pre><code>if (foo % bar == 0) // wenn foo teilbar durch bar
	...
else if (foo == 5) // wenn foo nicht teilbar durch bar und gleich 5
	...
else // wenn foo weder teilbar duch bar noch gleich 5
	...
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2352784</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2352784</guid><dc:creator><![CDATA[Nathan]]></dc:creator><pubDate>Sun, 15 Sep 2013 17:54:42 GMT</pubDate></item><item><title><![CDATA[Reply to Wozu else if on Sun, 15 Sep 2013 20:41:32 GMT]]></title><description><![CDATA[<p>Es gibt kein &quot;else if&quot;. Es gibt nur if und else. Schau:</p>
<pre><code>if( ... )
else{
    if( ... )
    else{
        if( ... )
        else ...
    }
}
</code></pre>
<p>Es ist haargenau dasselbe, wenn du alle geschweiften Klammern wegnimmst.<br />
Wird es dir jetzt klarer?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2352822</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2352822</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Sun, 15 Sep 2013 20:41:32 GMT</pubDate></item><item><title><![CDATA[Reply to Wozu else if on Sun, 15 Sep 2013 22:01:47 GMT]]></title><description><![CDATA[<p>manchmal kannste so code übersichtlicher und kürzer schreiben, z.b.</p>
<pre><code>if(kamel_hat_durchfall)
{
	kamel_kackt_heftig();
}
else
{
	if(kamel_hat_hunger)
	{
		kamel_frisst_gierig();
	}
}
</code></pre>
<p>kannste auch so schreiben</p>
<pre><code>if(kamel_hat_durchfall)
	kamel_kackt_heftig();
else if(kamel_hat_hunger) 
	kamel_frisst_gierig();
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2352834</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2352834</guid><dc:creator><![CDATA[foolie]]></dc:creator><pubDate>Sun, 15 Sep 2013 22:01:47 GMT</pubDate></item><item><title><![CDATA[Reply to Wozu else if on Sun, 15 Sep 2013 22:16:55 GMT]]></title><description><![CDATA[<p>hier darfst du z.b. einige geschweifte klammern (zu if gehörenden) auf gar keinen fall weglassen:</p>
<pre><code>if(kamel_hat_durchfall)
{
	kamel_kackt_heftig();
	kamel_guckt_doof_aus_der_wasche();
}
else
{
	if(kamel_hat_hunger)
	{
		kamel_frisst_gierig();
		kamel_ruelpst();
	}
}

kannste auch so schreiben

if(kamel_hat_durchfall)
{
	kamel_kackt_heftig();
	kamel_guckt_doof_aus_der_wasche();
}
else if(kamel_hat_hunger) 
{
	kamel_frisst_gierig();
	kamel_ruelpst();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2352837</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2352837</guid><dc:creator><![CDATA[foolie]]></dc:creator><pubDate>Sun, 15 Sep 2013 22:16:55 GMT</pubDate></item><item><title><![CDATA[Reply to Wozu else if on Mon, 16 Sep 2013 09:10:15 GMT]]></title><description><![CDATA[<p>kamelkacke schrieb:</p>
<blockquote>
<p>Wenn man eine if bedingung stellt, und die eingabe trifft zu, dann wird sie erfuellt.<br />
Bei else if haargenau so.</p>
</blockquote>
<p>Nein. Wenn die vorige Bedingung (das erste &quot;if&quot;) erfüllt war, wird &quot;else if&quot; nicht geprüft:</p>
<pre><code class="language-cpp">if (true)
  cout &lt;&lt; &quot;'true' ist erfüllt&quot;;
else if (true)
  cout &lt;&lt; &quot;'true' ist immer noch erfüllt&quot;;  // wird nie aufgerufen
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2352881</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2352881</guid><dc:creator><![CDATA[daddy_felix]]></dc:creator><pubDate>Mon, 16 Sep 2013 09:10:15 GMT</pubDate></item></channel></rss>