<?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[Funktion falsch aber warum?]]></title><description><![CDATA[<p>Hallo liebe Gemeinde.</p>
<p>Ich wollte ein Programm schreiben, das mir die Flaeche meines Gartens berechnet.</p>
<p>Hier dazu der Quellcode:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt; 
using namespace std;

int Area (int length, int width);

int main()
{
	int lengthOfYard;
	int widthOfYard;
	int areaOfYard;
	cout &lt;&lt; &quot;\nWie breit ist Ihr Garten?&quot; &lt;&lt; endl;
	cin  &gt;&gt; widthOfYard;
	cout &lt;&lt; &quot;\nWie lang ist ihr Garten?&quot; &lt;&lt; endl;
	cin  &gt;&gt; lengthOfYard;

	areaOfYard = Area(lengthOfYard, widthOfYard);

	cout &lt;&lt; &quot;\n Die Flaeche Ihres Gartens betraegt&quot;;
	cout &lt;&lt; areaOfYard;
	cout &lt;&lt; &quot;Quadratmeter!&quot; &lt;&lt; endl;

	return 0;
}
int Area (int l, int w)
{
	return yardLength *yardWidth;
}
</code></pre>
<p>Was ist daran falsch? Ich sehe leider den Fehler nicht...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/301569/funktion-falsch-aber-warum</link><generator>RSS for Node</generator><lastBuildDate>Tue, 11 Aug 2026 21:43:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/301569.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 30 Mar 2012 07:57:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Funktion falsch aber warum? on Fri, 30 Mar 2012 07:57:47 GMT]]></title><description><![CDATA[<p>Hallo liebe Gemeinde.</p>
<p>Ich wollte ein Programm schreiben, das mir die Flaeche meines Gartens berechnet.</p>
<p>Hier dazu der Quellcode:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt; 
using namespace std;

int Area (int length, int width);

int main()
{
	int lengthOfYard;
	int widthOfYard;
	int areaOfYard;
	cout &lt;&lt; &quot;\nWie breit ist Ihr Garten?&quot; &lt;&lt; endl;
	cin  &gt;&gt; widthOfYard;
	cout &lt;&lt; &quot;\nWie lang ist ihr Garten?&quot; &lt;&lt; endl;
	cin  &gt;&gt; lengthOfYard;

	areaOfYard = Area(lengthOfYard, widthOfYard);

	cout &lt;&lt; &quot;\n Die Flaeche Ihres Gartens betraegt&quot;;
	cout &lt;&lt; areaOfYard;
	cout &lt;&lt; &quot;Quadratmeter!&quot; &lt;&lt; endl;

	return 0;
}
int Area (int l, int w)
{
	return yardLength *yardWidth;
}
</code></pre>
<p>Was ist daran falsch? Ich sehe leider den Fehler nicht...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2196877</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2196877</guid><dc:creator><![CDATA[silent_max]]></dc:creator><pubDate>Fri, 30 Mar 2012 07:57:47 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion falsch aber warum? on Fri, 30 Mar 2012 08:08:09 GMT]]></title><description><![CDATA[<pre><code>g++ -o test test.cpp 
test.cpp: In function ‘int Area(int, int)’:
test.cpp:26:10: error: ‘yardLength’ was not declared in this scope
test.cpp:26:22: error: ‘yardWidth’ was not declared in this scope
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2196881</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2196881</guid><dc:creator><![CDATA[schwudde]]></dc:creator><pubDate>Fri, 30 Mar 2012 08:08:09 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion falsch aber warum? on Fri, 30 Mar 2012 08:10:43 GMT]]></title><description><![CDATA[<p>Wo sollen denn auf einmal yardLength/Width herkommen? Dei Funktion Area bekommt nur l und w übergeben.</p>
<p>Btw: In dem Zusammenhang von &quot;width&quot; und &quot;length&quot; zu sprechen, halte ich schon für etwas komisch. Gängiger wäre width und height, cx und cy etc.</p>
<p>Und es wäre für zukünftige Fragen durchaus überlegenswert, ob du nicht die Fehlermeldungen des Compilers ebenfalls posten würdest.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2196882</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2196882</guid><dc:creator><![CDATA[hno]]></dc:creator><pubDate>Fri, 30 Mar 2012 08:10:43 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion falsch aber warum? on Fri, 30 Mar 2012 08:17:04 GMT]]></title><description><![CDATA[<p>... überhaupt die Fehlermeldungen zu lesen bevor ich etwas poste.</p>
<p>Sorry Jungs.</p>
<p>Programm läuft.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2196886</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2196886</guid><dc:creator><![CDATA[silent_max]]></dc:creator><pubDate>Fri, 30 Mar 2012 08:17:04 GMT</pubDate></item></channel></rss>