<?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[Funktionsaufruf]]></title><description><![CDATA[<p>Hallo,<br />
bin Anfänger und wollte ein Programm schreiben, welches mir die Oberfläche eines Zylinders ausgibt. Hier der Code</p>
<p>#include &lt;iostream&gt;<br />
#include &lt;conio.h&gt;</p>
<p>using namespace std;</p>
<p>int main (void)<br />
{<br />
float c =2;<br />
float d=3;</p>
<p>float oberflaeche (c,d);</p>
<p>getch();<br />
return 0;<br />
}</p>
<p>float oberflaeche (float r, float h)<br />
{<br />
float a;<br />
a=2*3.14*r*h;<br />
cout &lt;&lt; a;<br />
}</p>
<p>Der Debugger sagt mir dann:,,Zu viele Initialisierungen'' (bezieht sich auf float oberflaeche (c,d) )<br />
Ich verstehe allerdings nicht, wo der Fehler ist!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/299405/funktionsaufruf</link><generator>RSS for Node</generator><lastBuildDate>Thu, 13 Aug 2026 06:12:32 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/299405.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 10 Feb 2012 12:23:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Funktionsaufruf on Fri, 10 Feb 2012 12:23:29 GMT]]></title><description><![CDATA[<p>Hallo,<br />
bin Anfänger und wollte ein Programm schreiben, welches mir die Oberfläche eines Zylinders ausgibt. Hier der Code</p>
<p>#include &lt;iostream&gt;<br />
#include &lt;conio.h&gt;</p>
<p>using namespace std;</p>
<p>int main (void)<br />
{<br />
float c =2;<br />
float d=3;</p>
<p>float oberflaeche (c,d);</p>
<p>getch();<br />
return 0;<br />
}</p>
<p>float oberflaeche (float r, float h)<br />
{<br />
float a;<br />
a=2*3.14*r*h;<br />
cout &lt;&lt; a;<br />
}</p>
<p>Der Debugger sagt mir dann:,,Zu viele Initialisierungen'' (bezieht sich auf float oberflaeche (c,d) )<br />
Ich verstehe allerdings nicht, wo der Fehler ist!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2179340</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2179340</guid><dc:creator><![CDATA[janiboy46]]></dc:creator><pubDate>Fri, 10 Feb 2012 12:23:29 GMT</pubDate></item><item><title><![CDATA[Reply to Funktionsaufruf on Fri, 10 Feb 2012 12:29:14 GMT]]></title><description><![CDATA[<p><code>float oberflaeche (c,d);</code> ist kein Funktionaufruf, sondern die Deklaration einer Funktion. Nochmal Grundlagen zu Funktionen und wie man sie aufruft studieren. Und dein Lehrwerk hat übrigens einen merkwürdigen Stil mit <code>int main(void)</code> und <code>return 0</code> aus der main (eher typisch für C) und einem total unnötigen und unportablem <code>conio.h</code> . Woher ist das?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2179343</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2179343</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Fri, 10 Feb 2012 12:29:14 GMT</pubDate></item><item><title><![CDATA[Reply to Funktionsaufruf on Fri, 10 Feb 2012 12:29:19 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Lies bitte mal was über Funktionen bei C++.<br />
z.Bsp. das hier<br />
<a href="http://www.cpp-tutor.de/cpp/le07/funktion.html" rel="nofollow">http://www.cpp-tutor.de/cpp/le07/funktion.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2179344</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2179344</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Fri, 10 Feb 2012 12:29:19 GMT</pubDate></item><item><title><![CDATA[Reply to Funktionsaufruf on Fri, 10 Feb 2012 12:37:10 GMT]]></title><description><![CDATA[<p>Und die Funktion <code>oberflaeche</code> gibt keinen Wert (mit return) zurück. Das musst du auch noch ergänzen, also</p>
<pre><code class="language-cpp">float oberflaeche (float r, float h)
{
float a;
a=2*3.14*r*h;
return a;
}
</code></pre>
<p>oder verkürzt:</p>
<pre><code class="language-cpp">float oberflaeche (float r, float h)
{
return 2*3.14*r*h;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2179348</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2179348</guid><dc:creator><![CDATA[inc7]]></dc:creator><pubDate>Fri, 10 Feb 2012 12:37:10 GMT</pubDate></item><item><title><![CDATA[Reply to Funktionsaufruf on Fri, 10 Feb 2012 17:25:55 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<p><code>float oberflaeche (c,d);</code> ist kein Funktionaufruf, sondern die Deklaration einer Funktion. Nochmal Grundlagen zu Funktionen und wie man sie aufruft studieren. Und dein Lehrwerk hat übrigens einen merkwürdigen Stil mit <code>int main(void)</code> und <code>return 0</code> aus der main (eher typisch für C) und einem total unnötigen und unportablem <code>conio.h</code> . Woher ist das?</p>
</blockquote>
<p>Das würde doch eher eine Variable oberflaeche vom Typ float deklarieren, die 2 Konstruktorparameter bekommt?! So sieht das der Compiler anscheinend auch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2179542</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2179542</guid><dc:creator><![CDATA[wxSkip]]></dc:creator><pubDate>Fri, 10 Feb 2012 17:25:55 GMT</pubDate></item><item><title><![CDATA[Reply to Funktionsaufruf on Fri, 10 Feb 2012 19:26:39 GMT]]></title><description><![CDATA[<p>Zusammengefasst: Du willst</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;

using namespace std;

float oberflaeche(float r, float h)
{
    return 2 * 3.14f * r * h;
}

int main()
{
    cout &lt;&lt; oberflaeche(2.f, 3.f) &lt;&lt; endl;
    cin.get();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2179594</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2179594</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Fri, 10 Feb 2012 19:26:39 GMT</pubDate></item><item><title><![CDATA[Reply to Funktionsaufruf on Fri, 10 Feb 2012 19:46:49 GMT]]></title><description><![CDATA[<p>Ich hätte mal noch ne Off-Topic-Frage. Gibt es eigentlich eine Regel die besagt, für welche Berechnungen man eher double und für welche man eher float benutzen sollte? Oder sollte man einfach, wenn man die Genauigkeit nicht benötigt, float benutzen? Andererseits spart man sich mit double die Promotion...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2179602</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2179602</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 10 Feb 2012 19:46:49 GMT</pubDate></item><item><title><![CDATA[Reply to Funktionsaufruf on Fri, 10 Feb 2012 20:44:42 GMT]]></title><description><![CDATA[<p>Welchen Vorteil hätte denn float?</p>
<p>(Die beiden Antworten die du nun wahrscheinlich gibst, gelten praktisch nur auf Grafikkarten und bei Netzwerkkommunikation. Und das sind auch die Zwecke wo man float nutzen muss (Grafikkarten) oder sich zumindest mal Gedanken darüber machen sollte (Kommunikation))</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2179618</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2179618</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Fri, 10 Feb 2012 20:44:42 GMT</pubDate></item><item><title><![CDATA[Reply to Funktionsaufruf on Sat, 11 Feb 2012 14:32:40 GMT]]></title><description><![CDATA[<p>Danke für die Hilfe!<br />
Habs jetzt geändert:</p>
<p>#include &lt;iostream&gt;<br />
#include &lt;conio.h&gt;</p>
<p>using namespace std;</p>
<p>float oberflaeche (float r, float h);</p>
<p>int main (void)<br />
{<br />
float c =2;<br />
float d=3;<br />
float e;</p>
<p>e= oberflaeche (c,d);<br />
cout &lt;&lt; e;</p>
<p>getch();<br />
return 0;<br />
}</p>
<p>float oberflaeche (float r, float h)<br />
{<br />
float a;<br />
a=2*3.14*r*h;<br />
return a;<br />
}</p>
<p>Funktioniert sogar <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
Und nochwas an SeppJ: Ich kenn das mit dem ,,int main (void)'' nur so. Weiß war, dass man da das void in der Klammer auch weglassen kann, aber ich machs trotzdem immer rein. Und den Header conio.h und getch ist nur dazu damit das dos fenster nach dem Debugging nicht direkt verschwindet</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2179803</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2179803</guid><dc:creator><![CDATA[janiboy46]]></dc:creator><pubDate>Sat, 11 Feb 2012 14:32:40 GMT</pubDate></item><item><title><![CDATA[Reply to Funktionsaufruf on Sat, 11 Feb 2012 15:32:25 GMT]]></title><description><![CDATA[<p>Besser wäre es, wenn du</p>
<pre><code class="language-cpp">system(&quot;PAUSE&quot;)
</code></pre>
<p>verwendest.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2179828</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2179828</guid><dc:creator><![CDATA[inc7]]></dc:creator><pubDate>Sat, 11 Feb 2012 15:32:25 GMT</pubDate></item></channel></rss>