<?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[Vorteil von typedef ggü. #define in C++]]></title><description><![CDATA[<p>Hallo!</p>
<p>Welchen konkreten Vorteil bringt in dem Fall ein typedef?</p>
<p><strong>#define DatenTyp_VXX DatenTyp_V7</strong><br />
vs.<br />
<strong>typedef DatenTyp_V7 DatenTyp_VXX;</strong></p>
<p>bzw. gibt es überhaupt einen Vorteil?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/322171/vorteil-von-typedef-ggü-define-in-c</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Jul 2026 08:07:54 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/322171.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 09 Dec 2013 17:36:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Vorteil von typedef ggü. #define in C++ on Mon, 09 Dec 2013 17:36:41 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Welchen konkreten Vorteil bringt in dem Fall ein typedef?</p>
<p><strong>#define DatenTyp_VXX DatenTyp_V7</strong><br />
vs.<br />
<strong>typedef DatenTyp_V7 DatenTyp_VXX;</strong></p>
<p>bzw. gibt es überhaupt einen Vorteil?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2370802</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2370802</guid><dc:creator><![CDATA[blablablubb]]></dc:creator><pubDate>Mon, 09 Dec 2013 17:36:41 GMT</pubDate></item><item><title><![CDATA[Reply to Vorteil von typedef ggü. #define in C++ on Mon, 09 Dec 2013 17:40:26 GMT]]></title><description><![CDATA[<p>blablablubb schrieb:</p>
<blockquote>
<p>Welchen konkreten Vorteil bringt in dem Fall ein typedef?</p>
</blockquote>
<p>- Bessere Fehlermeldungen<br />
- Fehler falls irgendjemand eine Klasse mit dem gleichen Namen definieren will<br />
- Ist echter Name im Namespace<br />
- Google ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2370804</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2370804</guid><dc:creator><![CDATA[dervorteil]]></dc:creator><pubDate>Mon, 09 Dec 2013 17:40:26 GMT</pubDate></item><item><title><![CDATA[Reply to Vorteil von typedef ggü. #define in C++ on Mon, 09 Dec 2013 17:42:08 GMT]]></title><description><![CDATA[<p>#define ist oft scheiße.<br />
Bei typedef wird ein richtiger Name erstellt, mit namespace und allem.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2370805</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2370805</guid><dc:creator><![CDATA[Marthog]]></dc:creator><pubDate>Mon, 09 Dec 2013 17:42:08 GMT</pubDate></item><item><title><![CDATA[Reply to Vorteil von typedef ggü. #define in C++ on Mon, 09 Dec 2013 17:48:39 GMT]]></title><description><![CDATA[<p>Zusätzlich:<br />
Die IDE unterstützt Dich bei #define vermutlich auch nicht mit Anmerkungen zu Methoden und Attributen o.ä.</p>
<p>Gibt auch viele Fallstricke:</p>
<pre><code class="language-cpp">typedef int* IntPointer;
#define DangerousIntPointer int*

DangerousIntPointer a, b, c; // nur a ist Pointer
</code></pre>
<p>Und man man kann Funktionszeiger mit #define nicht gescheit basteln.</p>
<p>Und die Namenskollisionen können ziemliche Probleme bereiten. Wenn man im template beispielsweise <code>typedef T value_type;</code> durch <code>#define value_type T</code> ersetzt, na dann viel Spaß... <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/2370809</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2370809</guid><dc:creator><![CDATA[Eisflamme]]></dc:creator><pubDate>Mon, 09 Dec 2013 17:48:39 GMT</pubDate></item><item><title><![CDATA[Reply to Vorteil von typedef ggü. #define in C++ on Mon, 09 Dec 2013 19:43:02 GMT]]></title><description><![CDATA[<p>Am wichtigsten ist wohl der Scope. <code>typedef</code> erzeugt ein dem Compiler bekanntes Symbol (im Gegensatz zu reiner Textersetzung) und kann in lokaleren Gültigkeitsbereichen neu definiert werden, ohne Konflikte zu erzeugen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2370834</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2370834</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Mon, 09 Dec 2013 19:43:02 GMT</pubDate></item></channel></rss>