<?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[void, parameter automatisch auf false setzen]]></title><description><![CDATA[<p>Hallo,</p>
<p>mein problem ist folgendes:</p>
<p>Ich habe ein void:</p>
<pre><code>void angle_drive(int angle,int speed, bool brake)
{
...
}
</code></pre>
<p>nun wird &quot;brake&quot; äußerst selten verwendet, deshalb würde ich es gerne so machen,<br />
dass wenn man die void so aufruft;<br />
angle_drive(20,255);<br />
brake auf false gesetzt wird.</p>
<p>Ist das möglich?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/286296/void-parameter-automatisch-auf-false-setzen</link><generator>RSS for Node</generator><lastBuildDate>Thu, 20 Aug 2026 23:10:23 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/286296.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 07 May 2011 11:11:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to void, parameter automatisch auf false setzen on Sat, 07 May 2011 11:11:19 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>mein problem ist folgendes:</p>
<p>Ich habe ein void:</p>
<pre><code>void angle_drive(int angle,int speed, bool brake)
{
...
}
</code></pre>
<p>nun wird &quot;brake&quot; äußerst selten verwendet, deshalb würde ich es gerne so machen,<br />
dass wenn man die void so aufruft;<br />
angle_drive(20,255);<br />
brake auf false gesetzt wird.</p>
<p>Ist das möglich?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2059971</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2059971</guid><dc:creator><![CDATA[Gast889]]></dc:creator><pubDate>Sat, 07 May 2011 11:11:19 GMT</pubDate></item><item><title><![CDATA[Reply to void, parameter automatisch auf false setzen on Sat, 07 May 2011 11:16:47 GMT]]></title><description><![CDATA[<p>Gast889 schrieb:</p>
<blockquote>
<p>Ich habe ein void:</p>
</blockquote>
<p>Du hast eine Funktion die <code>void</code> zurückgibt.</p>
<p>Gast889 schrieb:</p>
<blockquote>
<p>Ist das möglich?</p>
</blockquote>
<p>Ja:</p>
<pre><code class="language-cpp">void angle_drive(int angle,int speed, bool brake = true/*Standard-Wert*/)
{
}
</code></pre>
<p>Somit:</p>
<pre><code class="language-cpp">angle_drive(90, 30); //brake ist true
angle_drive(90, 30, true); //brake ist true
angle_drive(90, 30, false); //brake ist false
</code></pre>
<p>Achtung: Bei der Definition <strong>oder</strong> der Deklaration!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2059973</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2059973</guid><dc:creator><![CDATA[EOutOfResources]]></dc:creator><pubDate>Sat, 07 May 2011 11:16:47 GMT</pubDate></item><item><title><![CDATA[Reply to void, parameter automatisch auf false setzen on Sat, 07 May 2011 11:15:11 GMT]]></title><description><![CDATA[<p>Bei der <em>Deklaration</em>:</p>
<pre><code class="language-cpp">void angle_drive(int angle,int speed, bool brake = false);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2059974</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2059974</guid><dc:creator><![CDATA[TyRoXx]]></dc:creator><pubDate>Sat, 07 May 2011 11:15:11 GMT</pubDate></item><item><title><![CDATA[Reply to void, parameter automatisch auf false setzen on Sat, 07 May 2011 15:23:30 GMT]]></title><description><![CDATA[<p>EOutOfResources schrieb:</p>
<blockquote>
<p>Achtung: Bei der Definition <strong>oder</strong> der Deklaration!</p>
</blockquote>
<p>Nein, es muss <em>immer</em> bei der Deklaration gemacht werden. Bei der Definition ist nur erlaubt, wenn diese auch zugleich die Deklaration ist (es also keine alleinstehende Deklaration gibt).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2060061</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2060061</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Sat, 07 May 2011 15:23:30 GMT</pubDate></item></channel></rss>