<?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[Ausgaben nur in Debug Version]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte Ausgaben auf stdout schreiben - jedoch nur, wenn ich mich in der Debug Version befinde. Wenn das Programm im Release Modus kompiliert wird und läuft, soll der Funktionsaufruf für die Ausgabe garnicht erst stattfinden.</p>
<p>Ich könnte natürlich immer das machen:</p>
<pre><code class="language-cpp">#ifdef DEBUG
OutputDebugStr(&quot;moep&quot;);
#endif
</code></pre>
<p>Aber das sieht im Code ja doch hässlich aus. Gibt es da was fertiges oder eine Standardlösung? Ich benutze VS 2005 und Windows.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/225389/ausgaben-nur-in-debug-version</link><generator>RSS for Node</generator><lastBuildDate>Thu, 01 Oct 2026 09:29:31 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/225389.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 22 Oct 2008 18:43:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ausgaben nur in Debug Version on Wed, 22 Oct 2008 18:43:49 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte Ausgaben auf stdout schreiben - jedoch nur, wenn ich mich in der Debug Version befinde. Wenn das Programm im Release Modus kompiliert wird und läuft, soll der Funktionsaufruf für die Ausgabe garnicht erst stattfinden.</p>
<p>Ich könnte natürlich immer das machen:</p>
<pre><code class="language-cpp">#ifdef DEBUG
OutputDebugStr(&quot;moep&quot;);
#endif
</code></pre>
<p>Aber das sieht im Code ja doch hässlich aus. Gibt es da was fertiges oder eine Standardlösung? Ich benutze VS 2005 und Windows.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1603037</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1603037</guid><dc:creator><![CDATA[debugoutputter]]></dc:creator><pubDate>Wed, 22 Oct 2008 18:43:49 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgaben nur in Debug Version on Wed, 22 Oct 2008 18:47:38 GMT]]></title><description><![CDATA[<p>Mach dir ein Makro.</p>
<pre><code class="language-cpp">#ifdef DEBUG
#define OUTPUT_DEBUG_STRING(str) OutputDebugStr(str)
#else
#define OUTPUT_DEBUG_STRING(str) ;
#endif

OUTPUT_DEBUG_STRING(&quot;moep&quot;);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1603041</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1603041</guid><dc:creator><![CDATA[wwm]]></dc:creator><pubDate>Wed, 22 Oct 2008 18:47:38 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgaben nur in Debug Version on Wed, 22 Oct 2008 20:52:40 GMT]]></title><description><![CDATA[<p>Das gab es schon mal: <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-219825.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-219825.html</a></p>
<p>wwm schrieb:</p>
<blockquote>
<pre><code class="language-cpp">#else
#define OUTPUT_DEBUG_STRING(str) ;
#endif
</code></pre>
</blockquote>
<p>Hier würde ich <code>;</code> durch <code>(void)0</code> ersetzen. Eine Erklärung findest du auch im verlinkten Thread.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1603094</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1603094</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Wed, 22 Oct 2008 20:52:40 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgaben nur in Debug Version on Wed, 22 Oct 2008 21:49:20 GMT]]></title><description><![CDATA[<p>Und wieso nicht einfach so:</p>
<pre><code class="language-cpp">#ifdef DEBUG
#  define OUTPUT_DEBUG_STRING(str) OutputDebugStr(str)
#else
#  define OUTPUT_DEBUG_STRING(str)
#endif

OUTPUT_DEBUG_STRING(&quot;moep&quot;);
</code></pre>
<p>Ein leeres Makro ist auch erlaubt.</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1603111</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1603111</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Wed, 22 Oct 2008 21:49:20 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgaben nur in Debug Version on Thu, 23 Oct 2008 18:01:18 GMT]]></title><description><![CDATA[<p>Dravere schrieb:</p>
<blockquote>
<p>Ein leeres Makro ist auch erlaubt.</p>
</blockquote>
<p>Gut, das war mir gar nicht bekannt. Ich dachte, das hätte ich auch schon probiert, und es würde nicht gehen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1603580</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1603580</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Thu, 23 Oct 2008 18:01:18 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgaben nur in Debug Version on Thu, 23 Oct 2008 20:24:43 GMT]]></title><description><![CDATA[<p>Ich bild mir ein mit so einem Konstrukt auch schon mal Probleme gehabt zu haben.<br />
War glaub ich irgend ein embedded compiler</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1603640</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1603640</guid><dc:creator><![CDATA[vlad_tepesch]]></dc:creator><pubDate>Thu, 23 Oct 2008 20:24:43 GMT</pubDate></item></channel></rss>