<?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 mit Variablen Variablen]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe 7 CheckBoxen. Alle aktivierten sollen als Und-Verknüpfung ausgewertet werden. Hierzu habe ich das Ergebnis in einem Array iArray[7].</p>
<p>Beispiel: CheckBox 1 und 3 aktiviert<br />
Im Array steht 1011010</p>
<p>Dementsprechend ist die Und Verknüpfung 1,3 erfüllt.</p>
<p>Nun will ich nicht jede Eventualität mit einem If prüfen. Gibt es einen anderen Ansatz ..?</p>
<p>Andi</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/188552/if-mit-variablen-variablen</link><generator>RSS for Node</generator><lastBuildDate>Mon, 17 Aug 2026 01:09:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/188552.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 01 Aug 2007 16:35:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to If mit Variablen Variablen on Wed, 01 Aug 2007 16:35:13 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe 7 CheckBoxen. Alle aktivierten sollen als Und-Verknüpfung ausgewertet werden. Hierzu habe ich das Ergebnis in einem Array iArray[7].</p>
<p>Beispiel: CheckBox 1 und 3 aktiviert<br />
Im Array steht 1011010</p>
<p>Dementsprechend ist die Und Verknüpfung 1,3 erfüllt.</p>
<p>Nun will ich nicht jede Eventualität mit einem If prüfen. Gibt es einen anderen Ansatz ..?</p>
<p>Andi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1336710</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1336710</guid><dc:creator><![CDATA[AndiSsch]]></dc:creator><pubDate>Wed, 01 Aug 2007 16:35:13 GMT</pubDate></item><item><title><![CDATA[Reply to If mit Variablen Variablen on Wed, 01 Aug 2007 16:46:46 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Interpretiere dein Array als binäre Zahl und werte die dann aus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1336718</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1336718</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Wed, 01 Aug 2007 16:46:46 GMT</pubDate></item><item><title><![CDATA[Reply to If mit Variablen Variablen on Wed, 01 Aug 2007 19:13:11 GMT]]></title><description><![CDATA[<p>Aus CheckBox1 - 7 mache ich eine Binärzahl je nach Checked, also in meinem Beispiel:<br />
1010000</p>
<p>In meinem Ergebnisarray der Übereinstimmungen steht dann z. B.:<br />
1011001</p>
<p>Über eien Schleife prüfe ich die beiden Arrays. Wenn in CheckBoxArray an Position x eine 1 steht und an gleicher Position des Ergebnisarray auch -&gt; mache weiter. Wenn nicht -&gt; break;</p>
<p>So spare ich mir alle If-Konstellationen zu prüfen.</p>
<p>Vielen Dank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1336802</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1336802</guid><dc:creator><![CDATA[AndiSch]]></dc:creator><pubDate>Wed, 01 Aug 2007 19:13:11 GMT</pubDate></item><item><title><![CDATA[Reply to If mit Variablen Variablen on Thu, 02 Aug 2007 07:34:05 GMT]]></title><description><![CDATA[<p>Wenn du beide Arrays als Binärzahlen hast, kannst du auch mit Bit-Operatoren darauf arbeiten, da ersparst du dir die gesamte Schleife:</p>
<pre><code class="language-cpp">int boxes;// = 1010000
int array;// = 1011010
//baue beide Werte auf
if(boxes&amp;array == boxes)
  ... // alle wichtigen Bits im Array sind gesetzt - mache weiter
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1337041</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1337041</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 02 Aug 2007 07:34:05 GMT</pubDate></item></channel></rss>