<?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 abfrage in einer variabel]]></title><description><![CDATA[<p>kann man in einer variabel ne komplette if-abfrage reinpacken?</p>
<p>sprich</p>
<p>variabel1 = if x= 2...else .....</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/259829/if-abfrage-in-einer-variabel</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 17:14:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/259829.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 28 Jan 2010 09:12:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to if abfrage in einer variabel on Thu, 28 Jan 2010 09:12:19 GMT]]></title><description><![CDATA[<p>kann man in einer variabel ne komplette if-abfrage reinpacken?</p>
<p>sprich</p>
<p>variabel1 = if x= 2...else .....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1846197</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1846197</guid><dc:creator><![CDATA[klausioz]]></dc:creator><pubDate>Thu, 28 Jan 2010 09:12:19 GMT</pubDate></item><item><title><![CDATA[Reply to if abfrage in einer variabel on Thu, 28 Jan 2010 09:20:35 GMT]]></title><description><![CDATA[<p>So formuliert... nein. :p</p>
<p>Was du machen kannst, ist entweder das:</p>
<pre><code class="language-cpp">if(x==2) {
  variable=0;
}else {
  variable=1;
}
</code></pre>
<p>oder das:</p>
<pre><code class="language-cpp">variable=x==2 ? 0 : 1;  //wenn x==2 dann weise 0 zu, sonst 1
</code></pre>
<p>(ist wohl das, was du gesucht hast)</p>
<p>P.S.: &quot;=&quot; ist NICHT der Vergleichsoperator, sondern &quot;==&quot;. Mit &quot;=&quot; weist du einer Variable einen Wert zu.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1846202</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1846202</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Thu, 28 Jan 2010 09:20:35 GMT</pubDate></item><item><title><![CDATA[Reply to if abfrage in einer variabel on Thu, 28 Jan 2010 16:37:17 GMT]]></title><description><![CDATA[<p>Was meinst du damit? Dass die if abfrage ausgeführt wird, wenn du auf die Variable lesend zugreifst? Wenn es nur um da abhängige Zuweisen eines Wertes geht, dann gibt es (wie _matze schon gesagt hat) den ?:-operator.</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/16702">@_matze</a></p>
<pre><code class="language-cpp">variable = x != 2;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1846522</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1846522</guid><dc:creator><![CDATA[rüdiger]]></dc:creator><pubDate>Thu, 28 Jan 2010 16:37:17 GMT</pubDate></item><item><title><![CDATA[Reply to if abfrage in einer variabel on Thu, 28 Jan 2010 16:37:36 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-1819.html" rel="nofollow">rüdiger</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-8.html" rel="nofollow">Rund um die Programmierung</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1846523</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1846523</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Thu, 28 Jan 2010 16:37:36 GMT</pubDate></item></channel></rss>