<?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[Verständnis Problem]]></title><description><![CDATA[<p>Hi</p>
<p>könnt ihr mir bitte veraten wieso der Ausdrück &quot;false&quot; zurück gibt?</p>
<pre><code>int main(){

	int x = 7;
	bool y = x++ == 8 || x == 7;
	cout &lt;&lt; y &lt;&lt; endl;

	_getch();
	return 0;
}
</code></pre>
<p>Eigentlich heißt es doch &quot;Der ODER-Operator || liefert genau dann true, wenn mindestens ein Operand<br />
wahr ist&quot; und &quot;x == 7&quot; ist doch wahr.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/310678/verständnis-problem</link><generator>RSS for Node</generator><lastBuildDate>Tue, 04 Aug 2026 05:35:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/310678.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 18 Nov 2012 00:58:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Verständnis Problem on Sun, 18 Nov 2012 00:58:33 GMT]]></title><description><![CDATA[<p>Hi</p>
<p>könnt ihr mir bitte veraten wieso der Ausdrück &quot;false&quot; zurück gibt?</p>
<pre><code>int main(){

	int x = 7;
	bool y = x++ == 8 || x == 7;
	cout &lt;&lt; y &lt;&lt; endl;

	_getch();
	return 0;
}
</code></pre>
<p>Eigentlich heißt es doch &quot;Der ODER-Operator || liefert genau dann true, wenn mindestens ein Operand<br />
wahr ist&quot; und &quot;x == 7&quot; ist doch wahr.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2271928</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2271928</guid><dc:creator><![CDATA[Psycho-pass]]></dc:creator><pubDate>Sun, 18 Nov 2012 00:58:33 GMT</pubDate></item><item><title><![CDATA[Reply to Verständnis Problem on Sun, 18 Nov 2012 01:09:00 GMT]]></title><description><![CDATA[<p>Warum sollte x 7 sein? Der Ausdruck &quot;x++&quot; hat zwar den Wert von x vor dem ++, aber in jedem Ausdruck danach hat x ja schon den Wert x + 1.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2271930</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2271930</guid><dc:creator><![CDATA[cooky451]]></dc:creator><pubDate>Sun, 18 Nov 2012 01:09:00 GMT</pubDate></item><item><title><![CDATA[Reply to Verständnis Problem on Sun, 18 Nov 2012 01:14:18 GMT]]></title><description><![CDATA[<p>Nein, der ||-Operator (und der &amp;&amp;-Operator) haben einen Sequenzpunkt zwischen der linken und der rechten Seite. Daher sind alle Seiteneffekte der linken Seite (hier das x++) bereits eingetreten, also ist x==8. Diese beiden Operatoren haben noch eine andere interessante Eigenschaft, die sehr oft benutzt wird:<br />
<a href="http://en.wikipedia.org/wiki/Short-circuit_evaluation" rel="nofollow">http://en.wikipedia.org/wiki/Short-circuit_evaluation</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2271931</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2271931</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sun, 18 Nov 2012 01:14:18 GMT</pubDate></item><item><title><![CDATA[Reply to Verständnis Problem on Sun, 18 Nov 2012 01:18:10 GMT]]></title><description><![CDATA[<p>Jetzt sehe ich denn Fehler auch.<br />
Vielen dank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2271932</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2271932</guid><dc:creator><![CDATA[Psycho-pass]]></dc:creator><pubDate>Sun, 18 Nov 2012 01:18:10 GMT</pubDate></item></channel></rss>