<?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[Erkennt keinen Rückgabewert]]></title><description><![CDATA[<p>Bei dem Programm erkennt er nicht den Rückgabewert bei der Funkt. int Area().<br />
-&gt; yardlength, yardwidth</p>
<p>[/cpp]<br />
#include &lt;iostream.h&gt;</p>
<p>int area(int length, int width);</p>
<p>int main(){</p>
<p>int lengthofyard;<br />
int widthofyard;<br />
int areaofyard;</p>
<p>cout &lt;&lt; &quot;\nWie breit?&quot;;<br />
cin &gt;&gt; widthofyard;<br />
cout &lt;&lt; &quot;\nWie lang?&quot;;<br />
cin &gt;&gt; lengthofyard;</p>
<p>areaofyard=area(lengthofyard,widthofyard);</p>
<p>cout &lt;&lt; &quot;\nDie Flaeche ihres Gartens betraegt: &quot;;<br />
cout &lt;&lt; areaofyard;<br />
cout &lt;&lt; &quot; Quadratmeter&quot;;<br />
cout &lt;&lt; endl &lt;&lt; endl;</p>
<p>system(&quot;pause&quot;);<br />
return 0;<br />
}</p>
<p>int area(int l, int w){</p>
<p>return yardlength*yardwidth; // funktioniert nicht !!!! / möglich nur return l*w</p>
<p>}<br />
[cpp]</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/204930/erkennt-keinen-rückgabewert</link><generator>RSS for Node</generator><lastBuildDate>Thu, 08 Oct 2026 19:43:38 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/204930.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 08 Feb 2008 12:15:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Erkennt keinen Rückgabewert on Fri, 08 Feb 2008 12:15:17 GMT]]></title><description><![CDATA[<p>Bei dem Programm erkennt er nicht den Rückgabewert bei der Funkt. int Area().<br />
-&gt; yardlength, yardwidth</p>
<p>[/cpp]<br />
#include &lt;iostream.h&gt;</p>
<p>int area(int length, int width);</p>
<p>int main(){</p>
<p>int lengthofyard;<br />
int widthofyard;<br />
int areaofyard;</p>
<p>cout &lt;&lt; &quot;\nWie breit?&quot;;<br />
cin &gt;&gt; widthofyard;<br />
cout &lt;&lt; &quot;\nWie lang?&quot;;<br />
cin &gt;&gt; lengthofyard;</p>
<p>areaofyard=area(lengthofyard,widthofyard);</p>
<p>cout &lt;&lt; &quot;\nDie Flaeche ihres Gartens betraegt: &quot;;<br />
cout &lt;&lt; areaofyard;<br />
cout &lt;&lt; &quot; Quadratmeter&quot;;<br />
cout &lt;&lt; endl &lt;&lt; endl;</p>
<p>system(&quot;pause&quot;);<br />
return 0;<br />
}</p>
<p>int area(int l, int w){</p>
<p>return yardlength*yardwidth; // funktioniert nicht !!!! / möglich nur return l*w</p>
<p>}<br />
[cpp]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1451900</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1451900</guid><dc:creator><![CDATA[david3104]]></dc:creator><pubDate>Fri, 08 Feb 2008 12:15:17 GMT</pubDate></item><item><title><![CDATA[Reply to Erkennt keinen Rückgabewert on Fri, 08 Feb 2008 12:18:08 GMT]]></title><description><![CDATA[<p>In der Funktion gibt es auch nur die lokalen Variablen l und w. Der Compiler hat Recht.</p>
<p>(Und falls Dir diese Antwort kein bisschen hilft, sag bitte was Du von dem Codeabschnitt erwartest, dann kann man Dir erklären, warum es nicht funktioniert und/oder wie Du Dein Ziel trotzdem erreichst)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1451905</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1451905</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Fri, 08 Feb 2008 12:18:08 GMT</pubDate></item><item><title><![CDATA[Reply to Erkennt keinen Rückgabewert on Fri, 08 Feb 2008 12:21:53 GMT]]></title><description><![CDATA[<p>siehe auch<br />
<a href="http://www.ica1.uni-stuttgart.de/Courses_and_Lectures/C++/script/node12.html" rel="nofollow">http://www.ica1.uni-stuttgart.de/Courses_and_Lectures/C++/script/node12.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1451908</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1451908</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Fri, 08 Feb 2008 12:21:53 GMT</pubDate></item><item><title><![CDATA[Reply to Erkennt keinen Rückgabewert on Fri, 08 Feb 2008 13:08:34 GMT]]></title><description><![CDATA[<p>hi,</p>
<p>so wie ich das sehe kennt die funktion area die variablen nicht(yardlength; yardwidth)<br />
hier mein vorschlag:</p>
<p>int area(int l, int w)<br />
{ return int a=l*w;}</p>
<p>und in main hast du dann den wert auf dieser var!!!</p>
<p>das is also so mein erster eindruck darauf!!!!<br />
vielleicht is es aber auch ein anderes prob????!!!!!</p>
<p>grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1451952</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1451952</guid><dc:creator><![CDATA[wulvpak]]></dc:creator><pubDate>Fri, 08 Feb 2008 13:08:34 GMT</pubDate></item><item><title><![CDATA[Reply to Erkennt keinen Rückgabewert on Fri, 08 Feb 2008 16:46:13 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/11064">@wulvpak</a>: Und was willst du da mit a?</p>
<pre><code class="language-cpp">int main()
{
</code></pre>
<p>Öffnet dir den Lokalen Scope (in dem Fall den Scope der Funktion main).<br />
Variablen sind nur in diesem gültig!</p>
<pre><code class="language-cpp">int main()
{
    int foo(0);
    {
        int bar(1);
        std::cout &lt;&lt; foo &lt;&lt; bar &lt;&lt; std::endl;
    } // (1)
    std::cout &lt;&lt; foo &lt;&lt; bar &lt;&lt; std::endl;
}
</code></pre>
<p>Du wirst eine Fehlermeldung bekommen, weil bar nach (1) nichtmehr gültig ist und das Objekt bereits zerstört wurde!</p>
<pre><code class="language-cpp">inline int area(const int length, const int width)
{ return (length * width); }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1452107</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1452107</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Fri, 08 Feb 2008 16:46:13 GMT</pubDate></item></channel></rss>