<?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[Verstehe Makro nicht...(#define)]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe eine Verständnissproblem mit diesem Makro.</p>
<pre><code class="language-cpp">#define MY_USER_MESSAGE_CODES \
/* Common*/\
     M(Build = FIRST_APP_MSG)\
              M(Save)\
              M(Open)\
              M(Close)\
              M(HitTest) \
/* System Messages */\
    M(WM_Paint)                             /* Window */\
              M(WM_Close)
</code></pre>
<p>Verstehe ich nicht....<br />
&quot;#define nimmt eine textuelle Erstetzung vor und zwar<br />
MY_USER_MESSAGE_CODES mit....</p>
<p>Was in aller Welt ist M(...)</p>
<p>ich soll einen bestehenden C-Code umschreiben aber ich verstehe das define Zeug nicht.</p>
<p>Gruß<br />
Franky</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/262188/verstehe-makro-nicht-define</link><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Sep 2026 19:46:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/262188.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 02 Mar 2010 11:14:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Verstehe Makro nicht...(#define) on Tue, 02 Mar 2010 11:14:56 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe eine Verständnissproblem mit diesem Makro.</p>
<pre><code class="language-cpp">#define MY_USER_MESSAGE_CODES \
/* Common*/\
     M(Build = FIRST_APP_MSG)\
              M(Save)\
              M(Open)\
              M(Close)\
              M(HitTest) \
/* System Messages */\
    M(WM_Paint)                             /* Window */\
              M(WM_Close)
</code></pre>
<p>Verstehe ich nicht....<br />
&quot;#define nimmt eine textuelle Erstetzung vor und zwar<br />
MY_USER_MESSAGE_CODES mit....</p>
<p>Was in aller Welt ist M(...)</p>
<p>ich soll einen bestehenden C-Code umschreiben aber ich verstehe das define Zeug nicht.</p>
<p>Gruß<br />
Franky</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1863218</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1863218</guid><dc:creator><![CDATA[FrankTheFox]]></dc:creator><pubDate>Tue, 02 Mar 2010 11:14:56 GMT</pubDate></item><item><title><![CDATA[Reply to Verstehe Makro nicht...(#define) on Tue, 02 Mar 2010 11:18:33 GMT]]></title><description><![CDATA[<p>FrankTheFox schrieb:</p>
<blockquote>
<p>Was in aller Welt ist M(...)</p>
</blockquote>
<p>Woher sollen wir das wissen?</p>
<p>Wenn du eine moderne IDE hast, kannst du auf den Bezeichner rechtsklicken und sowas wie &quot;Gehe zur Definition&quot; auswählen. Dokumentation gibts keine?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1863221</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1863221</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Tue, 02 Mar 2010 11:18:33 GMT</pubDate></item><item><title><![CDATA[Reply to Verstehe Makro nicht...(#define) on Tue, 02 Mar 2010 11:30:19 GMT]]></title><description><![CDATA[<p>Nexus schrieb:</p>
<blockquote>
<p>Wenn du eine moderne IDE hast, kannst du auf den Bezeichner rechtsklicken und sowas wie &quot;Gehe zur Definition&quot; auswählen. Dokumentation gibts keine?</p>
</blockquote>
<ol>
<li>IDE Eclipse<br />
F3 über M bringt nichts weil Eclipse nichts anzeigt</li>
<li>Nein keine Dokumentation.<br />
(Dafür bin ich ja da..)</li>
</ol>
<p>Nach dieser Define-Orgie kommt...</p>
<pre><code class="language-cpp">#undef M
#define M(s) s,
typedef enum....

und später dann...

#undef M
#define M(s) #s,
static const char...

allerdings nachher und nicht vorher...
</code></pre>
<p>Gruß<br />
Frank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1863229</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1863229</guid><dc:creator><![CDATA[FrankTheFox]]></dc:creator><pubDate>Tue, 02 Mar 2010 11:30:19 GMT</pubDate></item><item><title><![CDATA[Reply to Verstehe Makro nicht...(#define) on Tue, 02 Mar 2010 11:31:38 GMT]]></title><description><![CDATA[<p>Wofür stehen denn die Backslashs im ersten Beitrag?<br />
Teilen die mit dass die Zeichenkette in der nächsten Zeile weitergeht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1863230</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1863230</guid><dc:creator><![CDATA[Zwischenfrager]]></dc:creator><pubDate>Tue, 02 Mar 2010 11:31:38 GMT</pubDate></item><item><title><![CDATA[Reply to Verstehe Makro nicht...(#define) on Tue, 02 Mar 2010 11:37:17 GMT]]></title><description><![CDATA[<p>Zwischenfrager schrieb:</p>
<blockquote>
<p>Wofür stehen denn die Backslashs im ersten Beitrag?<br />
Teilen die mit dass die Zeichenkette in der nächsten Zeile weitergeht?</p>
</blockquote>
<p>siehe <a href="http://en.wikipedia.org/wiki/C_preprocessor" rel="nofollow">hier</a>, Stichword &quot;line splicing&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1863235</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1863235</guid><dc:creator><![CDATA[krümelkacker]]></dc:creator><pubDate>Tue, 02 Mar 2010 11:37:17 GMT</pubDate></item><item><title><![CDATA[Reply to Verstehe Makro nicht...(#define) on Tue, 02 Mar 2010 12:01:03 GMT]]></title><description><![CDATA[<blockquote>
<p>allerdings nachher und nicht vorher...</p>
</blockquote>
<p>Das ist egal, der Präprozessor arbeitet mit so genannter <em>Lazy Evaluation</em>. Das heißt der Ausdruck wird wirklich erst dann ausgewertet, wenn das Makro konkret benutzt wird.</p>
<p>Beispiel:</p>
<pre><code class="language-cpp">#define WERT 1

#define ALIAS WERT

#undef WERT
#define WERT 2

ALIAS   // ergibt 2
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1863246</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1863246</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Tue, 02 Mar 2010 12:01:03 GMT</pubDate></item><item><title><![CDATA[Reply to Verstehe Makro nicht...(#define) on Tue, 02 Mar 2010 12:36:44 GMT]]></title><description><![CDATA[<p>Nun gut,</p>
<p>dann weiß ich was das M.. macht.</p>
<pre><code class="language-cpp">#define MY_USER_MESSAGE_CODES \
/* Common*/\
     M(Build = FIRST_APP_MSG)\
              M(Save)\
              M(Open)\
              M(Close)\
              M(HitTest) \
/* System Messages */\
    M(WM_Paint)                             /* Window */\
              M(WM_Close)
</code></pre>
<p>würde dann sobald MY_USER_MESSAGE_CODES im Code auftaucht</p>
<p>dort stehen :</p>
<p>Build,Save,Open,Close,HitTest,WM_Paint,WM_Close</p>
<p>(und wenn z.B. FIRST_APP_MSG = 2)<br />
tja und als ganzes betrachtet machts dann auch Sinn, weil</p>
<pre><code class="language-cpp">typedef enum { 
              MY_INTERNAL_SYSTEM_CODES,
              MY_USER_MESSAGE_CODES, 
              MY_USER_CODES
             } syncpool_message_types;
</code></pre>
<p>eine Aufzählung definiert (Was ja auch nicht schwer zu vertehen ist).</p>
<p>SeppJ schrieb:</p>
<blockquote>
<p>Das ist egal, der Präprozessor arbeitet mit so genannter <em>Lazy Evaluation</em>...</p>
</blockquote>
<p>Ja, war mir entfallen! Das ist des Rätsels Lösung....</p>
<p>Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1863264</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1863264</guid><dc:creator><![CDATA[FrankTheFox]]></dc:creator><pubDate>Tue, 02 Mar 2010 12:36:44 GMT</pubDate></item><item><title><![CDATA[Reply to Verstehe Makro nicht...(#define) on Tue, 02 Mar 2010 13:09:19 GMT]]></title><description><![CDATA[<p>FrankTheFox schrieb:</p>
<blockquote>
<p>Nach dieser Define-Orgie kommt...</p>
</blockquote>
<p>Haha <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1863286</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1863286</guid><dc:creator><![CDATA[freaky]]></dc:creator><pubDate>Tue, 02 Mar 2010 13:09:19 GMT</pubDate></item><item><title><![CDATA[Reply to Verstehe Makro nicht...(#define) on Tue, 02 Mar 2010 13:13:15 GMT]]></title><description><![CDATA[<p>Mal wieder ein gutes Beispiel dafür wie man seinen Code nicht schreibt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /><br />
rya.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1863292</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1863292</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Tue, 02 Mar 2010 13:13:15 GMT</pubDate></item></channel></rss>