<?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[Komische If-Abfrage!]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich hab eine ganz normale erstellt und zwar folgende:</p>
<pre><code class="language-cpp">if((y1 - entry_value &lt;= -1)|| ((y1 - entry_value) &gt; (map_.getHeight()-1)))
 return false;
</code></pre>
<p>Und ich will einfach return false zurückliefern, wenn y1-entry_value negativ wird also gleich -1 oder kleiner 0 muss noch akzeptiert werden!<br />
Das sollte ja so gehen oder?</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/241698/komische-if-abfrage</link><generator>RSS for Node</generator><lastBuildDate>Mon, 21 Sep 2026 07:47:09 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/241698.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 24 May 2009 21:57:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Komische If-Abfrage! on Sun, 24 May 2009 21:57:25 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich hab eine ganz normale erstellt und zwar folgende:</p>
<pre><code class="language-cpp">if((y1 - entry_value &lt;= -1)|| ((y1 - entry_value) &gt; (map_.getHeight()-1)))
 return false;
</code></pre>
<p>Und ich will einfach return false zurückliefern, wenn y1-entry_value negativ wird also gleich -1 oder kleiner 0 muss noch akzeptiert werden!<br />
Das sollte ja so gehen oder?</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1715116</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1715116</guid><dc:creator><![CDATA[_if]]></dc:creator><pubDate>Sun, 24 May 2009 21:57:25 GMT</pubDate></item><item><title><![CDATA[Reply to Komische If-Abfrage! on Sun, 24 May 2009 22:48:55 GMT]]></title><description><![CDATA[<p>jo, müßte gehen.<br />
welchen typ haben die beteiligten variablen? zufällug unsigned short?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1715130</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1715130</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sun, 24 May 2009 22:48:55 GMT</pubDate></item><item><title><![CDATA[Reply to Komische If-Abfrage! on Sun, 24 May 2009 23:01:25 GMT]]></title><description><![CDATA[<p>nein, sind jeweils int! Dann wirds wohl an etwas anderen liegen!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1715134</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1715134</guid><dc:creator><![CDATA[_if]]></dc:creator><pubDate>Sun, 24 May 2009 23:01:25 GMT</pubDate></item><item><title><![CDATA[Reply to Komische If-Abfrage! on Mon, 25 May 2009 00:26:29 GMT]]></title><description><![CDATA[<p>Wenn y1 positiv ist und entry_value auch postiv ist dann funktioniert</p>
<pre><code class="language-cpp">if(y1 - entry_value &lt;= -1)
    return false;
</code></pre>
<p>Wenn entry_value aber negativ ist oder y1 und entry_value, musst du bedenken das folgendes passiert:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;

int main()
{
    int y1 = 27;
    int entry_value = -29;

    if(y1 - entry_value &lt;= -1)
        std::cout &lt;&lt; &quot;Ich werde niemals geschrieben, weil das Ergebnis +56 ist!&quot;;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1715140</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1715140</guid><dc:creator><![CDATA[freaky]]></dc:creator><pubDate>Mon, 25 May 2009 00:26:29 GMT</pubDate></item><item><title><![CDATA[Reply to Komische If-Abfrage! on Mon, 25 May 2009 15:18:03 GMT]]></title><description><![CDATA[<p>_if schrieb:</p>
<blockquote>
<p>Das sollte ja so gehen oder?</p>
</blockquote>
<p>Was geht denn nicht? Hast du dir die Werte der Variablen angeschaut, bei denen nicht das erwartete Verhalten auftritt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1715531</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1715531</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Mon, 25 May 2009 15:18:03 GMT</pubDate></item></channel></rss>