<?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[Compilerflag für automatische Zälvariable]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>war es nicht so dass mit den neueren C++ Standards in</p>
<pre><code>for(int i=0; ...
</code></pre>
<p>das int i nicht mehr nötig ist? So dass man</p>
<pre><code>for(i=0;...
</code></pre>
<p>schreiben kann ohne i explizit vorher zu initialisieren?</p>
<p>Welchen Compiler Flag muss man beim GCC g++ setzen?<br />
Habs mit &quot;-std=c++0x&quot; probiert. Funktioniert aber irgendwie nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/265429/compilerflag-für-automatische-zälvariable</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Sep 2026 03:51:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/265429.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 22 Apr 2010 19:19:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Compilerflag für automatische Zälvariable on Thu, 22 Apr 2010 19:19:58 GMT]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>war es nicht so dass mit den neueren C++ Standards in</p>
<pre><code>for(int i=0; ...
</code></pre>
<p>das int i nicht mehr nötig ist? So dass man</p>
<pre><code>for(i=0;...
</code></pre>
<p>schreiben kann ohne i explizit vorher zu initialisieren?</p>
<p>Welchen Compiler Flag muss man beim GCC g++ setzen?<br />
Habs mit &quot;-std=c++0x&quot; probiert. Funktioniert aber irgendwie nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1886947</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1886947</guid><dc:creator><![CDATA[darkfate]]></dc:creator><pubDate>Thu, 22 Apr 2010 19:19:58 GMT</pubDate></item><item><title><![CDATA[Reply to Compilerflag für automatische Zälvariable on Thu, 22 Apr 2010 19:23:32 GMT]]></title><description><![CDATA[<p>Du musst den Typ natürlich immer angeben. Im neuen Standard wird es den &quot;auto&quot; Typ geben, dann kannst du folgendes schreiben:<br />
for (auto i = 0; ...)</p>
<p>Hat bei nem int aber keine großartige bedeutung, das ist eher für Iteratoren gedacht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1886949</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1886949</guid><dc:creator><![CDATA[Janjan]]></dc:creator><pubDate>Thu, 22 Apr 2010 19:23:32 GMT</pubDate></item><item><title><![CDATA[Reply to Compilerflag für automatische Zälvariable on Thu, 22 Apr 2010 19:24:36 GMT]]></title><description><![CDATA[<p>Nein, das ist zum Glück nicht so.</p>
<p>Was du wahrscheinlich meinst, ist Typinferenz mittels <code>auto</code> und <code>decltype</code> , welche in C++0x eingeführt wird.</p>
<pre><code class="language-cpp">for (auto i = 0; /* ... */);
</code></pre>
<p>Bei so einfachen Dingen wie <code>int</code> ist es meiner Ansicht nach klarer, falls der vollständige Typ hingeschrieben wird. Es sei denn, man möchte sich an einen nicht unmittelbar klaren Ausdruck (z.B. Rückgabewert einer Funktion) anpassen. Aber im Allgemeinen werde ich persönlich wohl sparsam mit <code>auto</code> und <code>decltype</code> umgehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1886950</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1886950</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Thu, 22 Apr 2010 19:24:36 GMT</pubDate></item><item><title><![CDATA[Reply to Compilerflag für automatische Zälvariable on Thu, 22 Apr 2010 19:24:50 GMT]]></title><description><![CDATA[<p>Du meinst wohl das <code>auto</code> Keyword:</p>
<p><a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Type_inference" rel="nofollow">http://en.wikipedia.org/wiki/C%2B%2B0x#Type_inference</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1886951</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1886951</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Thu, 22 Apr 2010 19:24:50 GMT</pubDate></item><item><title><![CDATA[Reply to Compilerflag für automatische Zälvariable on Thu, 22 Apr 2010 19:39:15 GMT]]></title><description><![CDATA[<p>Danke an Alle!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1886957</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1886957</guid><dc:creator><![CDATA[darkfate]]></dc:creator><pubDate>Thu, 22 Apr 2010 19:39:15 GMT</pubDate></item></channel></rss>