<?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[Zählvariable außerhalb von for benutzbar?]]></title><description><![CDATA[<p>im c/c++ quellcodes die mit ms visual c++ geschrieben wurden, finde ich häufig folgende schleifenkonstrukte.</p>
<pre><code class="language-cpp">for (int i = 0; i &lt; Irgendwas; i++)
{
  // ... was machen ...

  if (Bedingung_erfuellt)
    break;
}

// Zählvariable außerhalb weiterbenutzen !
if (i == xyz)
{
  // ... blah
}
</code></pre>
<p>ist das mal wieder winzigweich-mist?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/135285/zählvariable-außerhalb-von-for-benutzbar</link><generator>RSS for Node</generator><lastBuildDate>Fri, 28 Aug 2026 23:18:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/135285.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 01 Feb 2006 08:32:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zählvariable außerhalb von for benutzbar? on Wed, 01 Feb 2006 08:32:34 GMT]]></title><description><![CDATA[<p>im c/c++ quellcodes die mit ms visual c++ geschrieben wurden, finde ich häufig folgende schleifenkonstrukte.</p>
<pre><code class="language-cpp">for (int i = 0; i &lt; Irgendwas; i++)
{
  // ... was machen ...

  if (Bedingung_erfuellt)
    break;
}

// Zählvariable außerhalb weiterbenutzen !
if (i == xyz)
{
  // ... blah
}
</code></pre>
<p>ist das mal wieder winzigweich-mist?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/982743</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/982743</guid><dc:creator><![CDATA[Schleifschen]]></dc:creator><pubDate>Wed, 01 Feb 2006 08:32:34 GMT</pubDate></item><item><title><![CDATA[Reply to Zählvariable außerhalb von for benutzbar? on Wed, 01 Feb 2006 08:37:00 GMT]]></title><description><![CDATA[<p>Dann bist du vermutlich mit dem VC++ 6 zugange. Und dann ist das kein &quot;Winzigweich&quot;-Mist, sondern zum Zeitpunkt der Programmierung von VC++ 6 gab's noch keinen abgenommenen C++ Standard und der Scope von Variablen nach for-Schleifen war unklar. In der Tat ist solcher Code heutzutage falsch, damals war's aber &quot;okay&quot;.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/982748</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/982748</guid><dc:creator><![CDATA[7H3 N4C3R]]></dc:creator><pubDate>Wed, 01 Feb 2006 08:37:00 GMT</pubDate></item><item><title><![CDATA[Reply to Zählvariable außerhalb von for benutzbar? on Wed, 01 Feb 2006 08:54:14 GMT]]></title><description><![CDATA[<p>Es sind in der Tat Erweiterungen von MS.</p>
<p><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefZcforScope.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefZcforScope.asp</a></p>
<blockquote>
<p>Standard behavior is to let a for loop's initializer go out of scope after the for loop. <strong>Under /Ze, the for loop's initializer remains in scope until the local scope ends.</strong></p>
</blockquote>
<p><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_.2f.Za.2c_2f.Ze.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_.2f.Za.2c_2f.Ze.asp</a></p>
<blockquote>
<p>The Visual C++ compiler offers a number of features beyond those specified in either the ANSI C or ANSI C++ standards. These features are known collectively as Microsoft's extensions to C and C++. <strong>These extensions are available when the /Ze option, the default, is specified</strong> and are not available when the /Za option is specified.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/982773</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/982773</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 01 Feb 2006 08:54:14 GMT</pubDate></item><item><title><![CDATA[Reply to Zählvariable außerhalb von for benutzbar? on Wed, 01 Feb 2006 16:46:01 GMT]]></title><description><![CDATA[<p>Jaja, frei nach dem Prinzip &quot;it's not a bug, it's a feature&quot; <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/983277</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/983277</guid><dc:creator><![CDATA[.filmor]]></dc:creator><pubDate>Wed, 01 Feb 2006 16:46:01 GMT</pubDate></item><item><title><![CDATA[Reply to Zählvariable außerhalb von for benutzbar? on Wed, 01 Feb 2006 16:47:17 GMT]]></title><description><![CDATA[<p>Der GCC ist aber auch erst in späteren Versionen konstant der Meinung, die Zählvariable ginge bereits am Ende der for-Schleife out-of-scope...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/983280</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/983280</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Wed, 01 Feb 2006 16:47:17 GMT</pubDate></item></channel></rss>