<?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[if Anweisung]]></title><description><![CDATA[<p>Hi,<br />
was stimmt an dieser if Anweisung nicht:</p>
<pre><code class="language-cpp">int qsplatdrr::Resulution (int choice){
if (choice = 1){
    input=256;
}
if (choice =2 ){
    input = 512;
}
if (choice =3) {
    input = 1056;
}
else{
    input=256;
}
return input;
}
</code></pre>
<p>er schreibt mir immer:<br />
suggest parentheses around assignment used as truth value</p>
<p>warum will er da runde klammern???</p>
<p>Danke,<br />
lg Devil's Daughter</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/143601/if-anweisung</link><generator>RSS for Node</generator><lastBuildDate>Wed, 02 Sep 2026 06:48:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/143601.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 10 Apr 2006 08:32:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to if Anweisung on Mon, 10 Apr 2006 08:32:08 GMT]]></title><description><![CDATA[<p>Hi,<br />
was stimmt an dieser if Anweisung nicht:</p>
<pre><code class="language-cpp">int qsplatdrr::Resulution (int choice){
if (choice = 1){
    input=256;
}
if (choice =2 ){
    input = 512;
}
if (choice =3) {
    input = 1056;
}
else{
    input=256;
}
return input;
}
</code></pre>
<p>er schreibt mir immer:<br />
suggest parentheses around assignment used as truth value</p>
<p>warum will er da runde klammern???</p>
<p>Danke,<br />
lg Devil's Daughter</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1034300</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1034300</guid><dc:creator><![CDATA[Devil&#x27;s Daughter]]></dc:creator><pubDate>Mon, 10 Apr 2006 08:32:08 GMT</pubDate></item><item><title><![CDATA[Reply to if Anweisung on Mon, 10 Apr 2006 08:34:38 GMT]]></title><description><![CDATA[<p>versuchs mal mit: if(choice == 1)...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1034302</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1034302</guid><dc:creator><![CDATA[mib]]></dc:creator><pubDate>Mon, 10 Apr 2006 08:34:38 GMT</pubDate></item><item><title><![CDATA[Reply to if Anweisung on Mon, 10 Apr 2006 08:35:38 GMT]]></title><description><![CDATA[<p>= ist die Zuweisung, du benötigst == (Vergleich)<br />
Btw wäre es wohl besser, alle Anweisungen per else if zusammenzuführen - sonst überschreibt der letzte else-Zweig alle vorigen Zuweisungen. (oder du nimmst switch-case)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1034303</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1034303</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 10 Apr 2006 08:35:38 GMT</pubDate></item><item><title><![CDATA[Reply to if Anweisung on Mon, 10 Apr 2006 08:36:21 GMT]]></title><description><![CDATA[<p>Danke auf das hab ich vergessen</p>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1034304</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1034304</guid><dc:creator><![CDATA[Devil&#x27;s Daughter]]></dc:creator><pubDate>Mon, 10 Apr 2006 08:36:21 GMT</pubDate></item><item><title><![CDATA[Reply to if Anweisung on Mon, 10 Apr 2006 08:39:35 GMT]]></title><description><![CDATA[<p>und wie schreib ich dann die letzte anweisung??<br />
also wenn nichts gewählt wird??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1034306</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1034306</guid><dc:creator><![CDATA[Devil&#x27;s Daughter]]></dc:creator><pubDate>Mon, 10 Apr 2006 08:39:35 GMT</pubDate></item><item><title><![CDATA[Reply to if Anweisung on Mon, 10 Apr 2006 08:47:06 GMT]]></title><description><![CDATA[<p>Möglichkeit 1: if-else-Kaskade:</p>
<pre><code class="language-cpp">if(choice==1)
  input=256; 
else if (choice==2)
  input=512; 
else if (choice==3)
  input=1056; 
else
  input=256;
</code></pre>
<p>Möglichkeit 2: switch():</p>
<pre><code class="language-cpp">switch(choice)
{
case 1: input=256;break;//Achtung: die break's sind wichtig
case 2: input=512;break;
case 3: input=1056;break;
default:input=256;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1034312</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1034312</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 10 Apr 2006 08:47:06 GMT</pubDate></item><item><title><![CDATA[Reply to if Anweisung on Mon, 10 Apr 2006 08:48:15 GMT]]></title><description><![CDATA[<p>danke....super!!! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1034313</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1034313</guid><dc:creator><![CDATA[Devil&#x27;s Daughter]]></dc:creator><pubDate>Mon, 10 Apr 2006 08:48:15 GMT</pubDate></item><item><title><![CDATA[Reply to if Anweisung on Mon, 10 Apr 2006 08:55:45 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">if (choice == 1){
    input=256;
} else if (choice == 2){
    input = 512;
} else if (choice == 3) {
    input = 1056;
} else {
    input=256;
}

// oder:

switch (choice) {
case 2:
  input = 512;
  break;
case 3:
  input = 1056;
  break:
case 1: // fallthrough
default:
  input = 256;
};
</code></pre>
<p>Bist du dir eigentlich sicher dass input bei choice==3 1056 sein soll? Sieht fast verdächtig nach 1024 aus. Und falls dann input tatsächlich 256*2^(choice-1) ist würde ich das dann auch eher auf diese Weise angehen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1034316</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1034316</guid><dc:creator><![CDATA[finix]]></dc:creator><pubDate>Mon, 10 Apr 2006 08:55:45 GMT</pubDate></item></channel></rss>