<?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[Unterfunktionproblem]]></title><description><![CDATA[<p>Hallo!</p>
<p>hab ein kleines C++ Problem, ich will diesen einfache Programm:</p>
<pre><code>#include &lt;iostream&gt;
using namespace std;

int main()
{
 float note,b=0,anzahl,d=0,e=0, max=0, min=1000; //Definition der verschiedenen Zahlenwerte (float)
 cout &lt;&lt; &quot;Geben Sie ein, wie viele Tests Sie bewerten wollen: &quot;; //Textausgabe
 cin &gt;&gt; anzahl; //Werteingabe

   do //Beginn der do-while Schleife
   {cout &lt;&lt; &quot;Bitte Note eingeben: &quot;;
    b++;
    cin &gt;&gt; note; //Noteneingabe
    d=d+note;

 if (note&gt;max) //Wenn note&gt;max, Gleichsetzung
 {
    max=note;
 }

  if (note&lt;min) //Wenn note&lt;min, Gleichsetzung
  {
   min=note;
  }

   }

   while (b&lt;anzahl); //Bedingung und Aktionen von &quot;while&quot;

   e=d/anzahl; //Definition von e

   cout &lt;&lt; &quot;Durchschnittsnote: &quot;&lt;&lt; e &lt;&lt; endl; //Ausgabe der errechneten Werte
   cout &lt;&lt; &quot;Max.: &quot; &lt;&lt; max &lt;&lt; endl;
   cout &lt;&lt; &quot;Min.: &quot; &lt;&lt; min &lt;&lt; endl;

return 0;
}
</code></pre>
<p>in Unterfunktionen aufteilen lassen, so weit so gut, hier ist meine Version welche aber nicht funktioniert (Fehlermeldungen):</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;stdlib.h&gt;
using namespace std;

void beginn();
void ausgabe();

int main()
{
 float note,b=0,anzahl,d=0,e=0, max=0, min=1000; //Definition der verschiedenen Zahlenwerte (float)
 cout &lt;&lt; &quot;Geben Sie ein, wie viele Tests Sie bewerten wollen: &quot;; //Textausgabe
 cin &gt;&gt; anzahl; //Werteingabe

   do //Beginn der do-while Schleife
   {
       beginn(void);

 if (note&gt;max) //Wenn note&gt;max, Gleichsetzung
 {
    max=note;
 }

  if (note&lt;min) //Wenn note&lt;min, Gleichsetzung
  {
   min=note;
  }

   }

   while (b&lt;anzahl); //Bedingung und Aktionen von &quot;while&quot;

   e=d/anzahl; //Definition von e

   ausgabe(void);

return 0;
}

void beginn(void)
{
    cout &lt;&lt; &quot;Bitte Note eingeben: &quot;;
    b++;
    cin &gt;&gt; note; //Noteneingabe
    d=d+note;
return 0;
}

void ausgabe(void)
   {
   cout &lt;&lt; &quot;Durchschnittsnote: &quot;&lt;&lt; e &lt;&lt; endl; //Ausgabe der errechneten Werte
   cout &lt;&lt; &quot;Max.: &quot; &lt;&lt; max &lt;&lt; endl;
   cout &lt;&lt; &quot;Min.: &quot; &lt;&lt; min &lt;&lt; endl;
return 0;
}
</code></pre>
<p>Es will einfach nicht funktionieren, ich weiß das &quot;void&quot; keine Werte zurückgiebt, darum habe ich das RETURN am Ende jeder Unterfunktion eingegeben, dachte es wäre ne ziemlich einfache Aufgabe am Anfang, aber.........Pustekuchen. Hab auch schon probiert die verschiedenen floats in die Klammer rechts von VOID zu tippen, war aber auch nichts.....</p>
<p>Schon mal Danke im Voraus für die (hoffentlich) hilfreichen Antworten! <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="😉"
    /></p>
<p>Schönes WE noch,</p>
<p>Hallohallo</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/314202/unterfunktionproblem</link><generator>RSS for Node</generator><lastBuildDate>Sat, 01 Aug 2026 09:48:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/314202.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 23 Feb 2013 14:03:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Unterfunktionproblem on Sat, 23 Feb 2013 14:03:02 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>hab ein kleines C++ Problem, ich will diesen einfache Programm:</p>
<pre><code>#include &lt;iostream&gt;
using namespace std;

int main()
{
 float note,b=0,anzahl,d=0,e=0, max=0, min=1000; //Definition der verschiedenen Zahlenwerte (float)
 cout &lt;&lt; &quot;Geben Sie ein, wie viele Tests Sie bewerten wollen: &quot;; //Textausgabe
 cin &gt;&gt; anzahl; //Werteingabe

   do //Beginn der do-while Schleife
   {cout &lt;&lt; &quot;Bitte Note eingeben: &quot;;
    b++;
    cin &gt;&gt; note; //Noteneingabe
    d=d+note;

 if (note&gt;max) //Wenn note&gt;max, Gleichsetzung
 {
    max=note;
 }

  if (note&lt;min) //Wenn note&lt;min, Gleichsetzung
  {
   min=note;
  }

   }

   while (b&lt;anzahl); //Bedingung und Aktionen von &quot;while&quot;

   e=d/anzahl; //Definition von e

   cout &lt;&lt; &quot;Durchschnittsnote: &quot;&lt;&lt; e &lt;&lt; endl; //Ausgabe der errechneten Werte
   cout &lt;&lt; &quot;Max.: &quot; &lt;&lt; max &lt;&lt; endl;
   cout &lt;&lt; &quot;Min.: &quot; &lt;&lt; min &lt;&lt; endl;

return 0;
}
</code></pre>
<p>in Unterfunktionen aufteilen lassen, so weit so gut, hier ist meine Version welche aber nicht funktioniert (Fehlermeldungen):</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;stdlib.h&gt;
using namespace std;

void beginn();
void ausgabe();

int main()
{
 float note,b=0,anzahl,d=0,e=0, max=0, min=1000; //Definition der verschiedenen Zahlenwerte (float)
 cout &lt;&lt; &quot;Geben Sie ein, wie viele Tests Sie bewerten wollen: &quot;; //Textausgabe
 cin &gt;&gt; anzahl; //Werteingabe

   do //Beginn der do-while Schleife
   {
       beginn(void);

 if (note&gt;max) //Wenn note&gt;max, Gleichsetzung
 {
    max=note;
 }

  if (note&lt;min) //Wenn note&lt;min, Gleichsetzung
  {
   min=note;
  }

   }

   while (b&lt;anzahl); //Bedingung und Aktionen von &quot;while&quot;

   e=d/anzahl; //Definition von e

   ausgabe(void);

return 0;
}

void beginn(void)
{
    cout &lt;&lt; &quot;Bitte Note eingeben: &quot;;
    b++;
    cin &gt;&gt; note; //Noteneingabe
    d=d+note;
return 0;
}

void ausgabe(void)
   {
   cout &lt;&lt; &quot;Durchschnittsnote: &quot;&lt;&lt; e &lt;&lt; endl; //Ausgabe der errechneten Werte
   cout &lt;&lt; &quot;Max.: &quot; &lt;&lt; max &lt;&lt; endl;
   cout &lt;&lt; &quot;Min.: &quot; &lt;&lt; min &lt;&lt; endl;
return 0;
}
</code></pre>
<p>Es will einfach nicht funktionieren, ich weiß das &quot;void&quot; keine Werte zurückgiebt, darum habe ich das RETURN am Ende jeder Unterfunktion eingegeben, dachte es wäre ne ziemlich einfache Aufgabe am Anfang, aber.........Pustekuchen. Hab auch schon probiert die verschiedenen floats in die Klammer rechts von VOID zu tippen, war aber auch nichts.....</p>
<p>Schon mal Danke im Voraus für die (hoffentlich) hilfreichen Antworten! <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="😉"
    /></p>
<p>Schönes WE noch,</p>
<p>Hallohallo</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2301352</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2301352</guid><dc:creator><![CDATA[Hallohallo]]></dc:creator><pubDate>Sat, 23 Feb 2013 14:03:02 GMT</pubDate></item><item><title><![CDATA[Reply to Unterfunktionproblem on Sat, 23 Feb 2013 17:31:01 GMT]]></title><description><![CDATA[<p>Dein Hauptproblem ist, dass die Variablen in den Funktionen nicht &quot;sichtbar&quot; sind.<br />
Üblicherweise übergibst Du Variablen aus dem Hauptprogramm an Funktionen beim Funktionsaufruf. Zum Beispiel:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;

void ausgabe(const float&amp;, const float&amp;, const float&amp;);
void tu_nix();

int main(){
  float min = 42.0f, max = 4711.f, act = 1701.0f;
  ausgabe(act, min, max);  // Funktion mit Argumenten
  tu_nix(); // Funktion ohne Argumente
}

void ausgabe(const float&amp; act, const float&amp; min, const float&amp; max)
   {
     if(min &lt; act &amp;&amp; act &lt; max)
       std::cout &lt;&lt; act &lt;&lt; &quot; liegt zwischen &quot; &lt;&lt; min &lt;&lt; &quot; und &quot; &lt;&lt; max &lt;&lt; &quot;.\n&quot;;
   }

void tu_nix(){}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2301420</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2301420</guid><dc:creator><![CDATA[Furble Wurble]]></dc:creator><pubDate>Sat, 23 Feb 2013 17:31:01 GMT</pubDate></item><item><title><![CDATA[Reply to Unterfunktionproblem on Sat, 23 Feb 2013 21:00:16 GMT]]></title><description><![CDATA[<p>Danke für die Antwort!!!</p>
<p>Hab es probiert, hilft aber auch nichts, krieg leider noch immer Fehlermeldungen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2301469</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2301469</guid><dc:creator><![CDATA[Hallohallo]]></dc:creator><pubDate>Sat, 23 Feb 2013 21:00:16 GMT</pubDate></item><item><title><![CDATA[Reply to Unterfunktionproblem on Sat, 23 Feb 2013 21:05:50 GMT]]></title><description><![CDATA[<p>Dank meiner hellseherischen Fähigkeiten bin ich nun in der Lage, die Lösung für dein Problem herauszufinden.<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2301470</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2301470</guid><dc:creator><![CDATA[Nathan]]></dc:creator><pubDate>Sat, 23 Feb 2013 21:05:50 GMT</pubDate></item><item><title><![CDATA[Reply to Unterfunktionproblem on Sat, 23 Feb 2013 21:07:42 GMT]]></title><description><![CDATA[<p>Nathan schrieb:</p>
<blockquote>
<p>Dank meiner hellseherischen Fähigkeiten bin ich nun in der Lage, die Lösung für dein Problem herauszufinden.<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
</blockquote>
<p>bist du aber fies daste ihm nicht den fehler zeigst!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2301471</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2301471</guid><dc:creator><![CDATA[hellseh0r]]></dc:creator><pubDate>Sat, 23 Feb 2013 21:07:42 GMT</pubDate></item><item><title><![CDATA[Reply to Unterfunktionproblem on Sat, 23 Feb 2013 21:24:59 GMT]]></title><description><![CDATA[<p>Hallohallo schrieb:</p>
<blockquote>
<p>Hab es probiert, hilft aber auch nichts, krieg leider noch immer Fehlermeldungen...</p>
</blockquote>
<p>Das war ja auch nur ein Problem - Dein Programm müsste jetzt schon anders aussehen. Und die Fehlermeldungen müssten andere sein.<br />
Soll jetzt jemand erahnen, welche Fehler noch im Code sind?</p>
<p>Siehe: <a href="http://www.c-plusplus.net/forum/304133" rel="nofollow">Den richtigen Code posten...</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2301474</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2301474</guid><dc:creator><![CDATA[Furble Wurble]]></dc:creator><pubDate>Sat, 23 Feb 2013 21:24:59 GMT</pubDate></item><item><title><![CDATA[Reply to Unterfunktionproblem on Sat, 23 Feb 2013 21:57:40 GMT]]></title><description><![CDATA[<pre><code>#include &lt;iostream&gt;
#include &lt;stdlib.h&gt;
using namespace std;

void beginn(float&amp;, float&amp;, float&amp;);
void ausgabe(float&amp;);

int main()
{
   float&amp; anzahl=0, max=0, min=1000; //Definition der verschiedenen Zahlenwerte (float)
   cout &lt;&lt; &quot;Geben Sie ein, wie viele Tests Sie bewerten wollen: &quot;; //Textausgabe
   cin &gt;&gt; anzahl; //Werteingabe

   do //Beginn der do-while Schleife
   {
    beginn(float&amp; b; float&amp; d; float&amp; note);

     if (note&gt;max) //Wenn note&gt;max, Gleichsetzung
     {
     max=note;
     }

       if (note&lt;min) //Wenn note&lt;min, Gleichsetzung
       {
       min=note;
       }

   }

   while (b&lt;anzahl); //Bedingung und Aktionen von &quot;while&quot;

   e=d/anzahl; //Definition von e

   ausgabe(float&amp; e);

return 0;
}

void beginn(float&amp; b, const float&amp; d, const float&amp; note)
      {
      cout &lt;&lt; &quot;Bitte Note eingeben: &quot;;
      b++;
      cin &gt;&gt; note; //Noteneingabe
      d=d+note;
      }

void ausgabe(float&amp; e)
        {
        cout &lt;&lt; &quot;Durchschnittsnote: &quot;&lt;&lt; e &lt;&lt; endl; //Ausgabe der errechneten Werte
        cout &lt;&lt; &quot;Max.: &quot; &lt;&lt; max &lt;&lt; endl;
        cout &lt;&lt; &quot;Min.: &quot; &lt;&lt; min &lt;&lt; endl;
        }
</code></pre>
<p>Fehlermeldungen: Fehlermeldungen sind nicht kopierbar, steckt es mal in euren Compiler und seht selbst, bei mir sind's noch immer 14 errors, die meisten davon: Nicht deklarierte Zahlen in den ersten Programmzeilen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2301480</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2301480</guid><dc:creator><![CDATA[Hallohallo]]></dc:creator><pubDate>Sat, 23 Feb 2013 21:57:40 GMT</pubDate></item><item><title><![CDATA[Reply to Unterfunktionproblem on Sat, 23 Feb 2013 22:19:34 GMT]]></title><description><![CDATA[<p>Der Code ist derart, dass ich vorschlage:<br />
Du setzt Dich nochmal hin, schaust in das Buch, mit dem Du C++ lernen willst und schreibst einfachere Programme.</p>
<p>Es muss IMHO deutlich mehr Substanz an C++-Wissen auf Deiner Seite vorhanden sein, damit das hier erquickend für beide Seiten ist.</p>
<p>Nix für ungut...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2301484</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2301484</guid><dc:creator><![CDATA[Furble Wurble]]></dc:creator><pubDate>Sat, 23 Feb 2013 22:19:34 GMT</pubDate></item><item><title><![CDATA[Reply to Unterfunktionproblem on Sat, 23 Feb 2013 22:23:46 GMT]]></title><description><![CDATA[<p>[code=&quot;cli&quot;]</p>
<p>#include &lt;iostream&gt;<br />
#include &lt;stdlib.h&gt;<br />
using namespace std;</p>
<p>void beginn();<br />
void ausgabe();</p>
<p>int main()<br />
{<br />
float anzahl=0, max=0, min=1000, note,b,d,e; //Definition der verschiedenen Zahlenwerte (float)<br />
cout &lt;&lt; &quot;Geben Sie ein, wie viele Tests Sie bewerten wollen: &quot;; //Textausgabe<br />
cin &gt;&gt; anzahl; //Werteingabe</p>
<p>do //Beginn der do-while Schleife<br />
{<br />
void beginn(float b, float d, float note);</p>
<p>if (note&gt;max) //Wenn note&gt;max, Gleichsetzung<br />
{<br />
max=note;<br />
}</p>
<p>if (note&lt;min) //Wenn note&lt;min, Gleichsetzung<br />
{<br />
min=note;<br />
}</p>
<p>}</p>
<p>while (b&lt;anzahl); //Bedingung und Aktionen von &quot;while&quot;</p>
<p>e=d/anzahl; //Definition von e</p>
<p>void ausgabe(float e);</p>
<p>return 0;<br />
}</p>
<p>void beginn(float b, float d, float note)<br />
{<br />
cout &lt;&lt; &quot;Bitte Note eingeben: &quot;;<br />
b++;<br />
cin &gt;&gt; note; //Noteneingabe<br />
d=d+note;<br />
}</p>
<p>void ausgabe(float e, float max, float min)<br />
{<br />
cout &lt;&lt; &quot;Durchschnittsnote: &quot;&lt;&lt; e; //Ausgabe der errechneten Werte<br />
cout &lt;&lt; &quot;Max.: &quot; &lt;&lt; max;<br />
cout &lt;&lt; &quot;Min.: &quot; &lt;&lt; min;<br />
}</p>
<p>[code=&quot;cpp&quot;]</p>
<p>Hab die Fehlercodes jetzt alle ausgemärzt, das einzige Problem was ich noch habe ist, dass die Werte nicht in die Hauptschleife zurückgegeben werden, sprich ich geb die Anzahl der zu bewertenden Teste ein und dann ist tote Hose da die Werte der Nebenfunktion &quot;beginn&quot; nicht zurückgegeben werden, woran liegt das?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2301485</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2301485</guid><dc:creator><![CDATA[Hallohallo]]></dc:creator><pubDate>Sat, 23 Feb 2013 22:23:46 GMT</pubDate></item><item><title><![CDATA[Reply to Unterfunktionproblem on Sat, 23 Feb 2013 22:25:25 GMT]]></title><description><![CDATA[<p>Sorry, hier gleich nochmal:</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;stdlib.h&gt;
using namespace std;

void beginn();
void ausgabe();

int main()
{
   float anzahl=0, max=0, min=1000, note,b,d,e; //Definition der verschiedenen Zahlenwerte (float)
   cout &lt;&lt; &quot;Geben Sie ein, wie viele Tests Sie bewerten wollen: &quot;; //Textausgabe
   cin &gt;&gt; anzahl; //Werteingabe

   do //Beginn der do-while Schleife
   {
     void beginn(float b, float d, float note);

     if (note&gt;max) //Wenn note&gt;max, Gleichsetzung
     {
     max=note;
     }

       if (note&lt;min) //Wenn note&lt;min, Gleichsetzung
       {
       min=note;
       }

   }

   while (b&lt;anzahl); //Bedingung und Aktionen von &quot;while&quot;

   e=d/anzahl; //Definition von e

   void ausgabe(float e);

return 0;
}

void beginn(float b, float d, float note)
      {
      cout &lt;&lt; &quot;Bitte Note eingeben: &quot;;
      b++;
      cin &gt;&gt; note; //Noteneingabe
      d=d+note;
      }

void ausgabe(float e, float max, float min)
        {
        cout &lt;&lt; &quot;Durchschnittsnote: &quot;&lt;&lt; e; //Ausgabe der errechneten Werte
        cout &lt;&lt; &quot;Max.: &quot; &lt;&lt; max;
        cout &lt;&lt; &quot;Min.: &quot; &lt;&lt; min;
        }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2301486</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2301486</guid><dc:creator><![CDATA[Hallohallo]]></dc:creator><pubDate>Sat, 23 Feb 2013 22:25:25 GMT</pubDate></item><item><title><![CDATA[Reply to Unterfunktionproblem on Sat, 23 Feb 2013 22:26:12 GMT]]></title><description><![CDATA[<p>Furble Wurble schrieb:</p>
<blockquote>
<pre><code class="language-cpp">void ausgabe(const float&amp;, const float&amp;, const float&amp;);
</code></pre>
</blockquote>
<p>Wieso const-ref Furble? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2301487</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2301487</guid><dc:creator><![CDATA[out]]></dc:creator><pubDate>Sat, 23 Feb 2013 22:26:12 GMT</pubDate></item><item><title><![CDATA[Reply to Unterfunktionproblem on Sun, 24 Feb 2013 02:12:40 GMT]]></title><description><![CDATA[<p>Hallohallo schrieb:</p>
<blockquote>
<p>Hallo!</p>
<p>hab ein kleines C++ Problem, ich will diesen einfache Programm:</p>
<pre><code>#include &lt;iostream&gt;
using namespace std;

int main()
{
 float note,b=0,anzahl,d=0,e=0, max=0, min=1000; //Definition der verschiedenen Zahlenwerte (float)
 cout &lt;&lt; &quot;Geben Sie ein, wie viele Tests Sie bewerten wollen: &quot;; //Textausgabe
 cin &gt;&gt; anzahl; //Werteingabe

   do //Beginn der do-while Schleife
   {cout &lt;&lt; &quot;Bitte Note eingeben: &quot;;
    b++;
    cin &gt;&gt; note; //Noteneingabe
    d=d+note;

 if (note&gt;max) //Wenn note&gt;max, Gleichsetzung
 {
    max=note;
 }

  if (note&lt;min) //Wenn note&lt;min, Gleichsetzung
  {
   min=note;
  }

   }

   while (b&lt;anzahl); //Bedingung und Aktionen von &quot;while&quot;

   e=d/anzahl; //Definition von e

   cout &lt;&lt; &quot;Durchschnittsnote: &quot;&lt;&lt; e &lt;&lt; endl; //Ausgabe der errechneten Werte
   cout &lt;&lt; &quot;Max.: &quot; &lt;&lt; max &lt;&lt; endl;
   cout &lt;&lt; &quot;Min.: &quot; &lt;&lt; min &lt;&lt; endl;

return 0;
}
</code></pre>
<p>in Unterfunktionen aufteilen lassen</p>
</blockquote>
<p>Das Vorhaben erscheint mir nicht sinnvoll.<br />
Ich bin ein Freund kleiner, sehr kleiner und extrem kleiner Funktionen, baue bei 200 Dateien im Durchschnitt 6 Zeilen pro Funktion (außer GUI), und würde hier dennoch alles in der main() lassen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2301520</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2301520</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sun, 24 Feb 2013 02:12:40 GMT</pubDate></item><item><title><![CDATA[Reply to Unterfunktionproblem on Sun, 24 Feb 2013 06:08:03 GMT]]></title><description><![CDATA[<p>Hallohallo schrieb:</p>
<blockquote>
<p>Fehlermeldungen: Fehlermeldungen sind nicht kopierbar, steckt es mal in euren Compiler und seht selbst (...)</p>
</blockquote>
<p>*FACE...</p>
<p>...wait for it...</p>
<p>...PALM*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2301542</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2301542</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Sun, 24 Feb 2013 06:08:03 GMT</pubDate></item><item><title><![CDATA[Reply to Unterfunktionproblem on Thu, 12 Jun 2014 10:24:28 GMT]]></title><description><![CDATA[<p>...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2301543</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2301543</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Thu, 12 Jun 2014 10:24:28 GMT</pubDate></item><item><title><![CDATA[Reply to Unterfunktionproblem on Sun, 24 Feb 2013 06:31:30 GMT]]></title><description><![CDATA[<p>Hallohallo schrieb:</p>
<blockquote>
<p>Fehlermeldungen: Fehlermeldungen sind nicht kopierbar, steckt es mal in euren Compiler und seht selbst, bei mir sind's noch immer 14 errors, die meisten davon: Nicht deklarierte Zahlen in den ersten Programmzeilen.</p>
</blockquote>
<p>Vielleicht sind sie in Deiner IDE nicht markierbar. Also nicht kopierbar per Markieren und Kopieren.<br />
Probier es anders. Zum Beispiel rechte Maustaste und im erscheinenden Kontextment &quot;Kopieren&quot; wählen.<br />
Oder sag, welche IDE es ist und jemand findet es heraus, wie es geht.<br />
Zur höchsten Not den Compiler aus der Konsole aufrufen und die Fehler in eine Datei schicken. Oder ideone benutzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2301545</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2301545</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sun, 24 Feb 2013 06:31:30 GMT</pubDate></item><item><title><![CDATA[Reply to Unterfunktionproblem on Sun, 24 Feb 2013 10:39:00 GMT]]></title><description><![CDATA[<p>out schrieb:</p>
<blockquote>
<p>Furble Wurble schrieb:</p>
<blockquote>
<pre><code class="language-cpp">void ausgabe(const float&amp;, const float&amp;, const float&amp;);
</code></pre>
</blockquote>
<p>Wieso const-ref Furble? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
</blockquote>
<p>My bad... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /><br />
Zu lange hin und her editiert. Denk Dir einfach eine Übergabe per Wert.</p>
<p>@Hallohallo:<br />
Hmm: hast ja innerhalb von 25 Minuten gestern noch die übelsten Syntaxfehler rausgebügelt. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Schau Dir nochmal an, wie in C++ Funktionen aufgerufen werden, und wie Du Argumente übergibst (per Wert, bzw. per Referenz).<br />
Z.B. werden in swordfishs <code>eingabe_2()</code> beide Konventionen genutzt.<br />
Allgemein solltest Du aus den Beispielen hier im Thread sehen, wie Funktionen nicht aufgerufen werden (Dein Code), bzw. wie sie aufgerufen werden (alle anderen Beispiele).</p>
<p>Glückauf!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2301595</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2301595</guid><dc:creator><![CDATA[Furble Wurble]]></dc:creator><pubDate>Sun, 24 Feb 2013 10:39:00 GMT</pubDate></item><item><title><![CDATA[Reply to Unterfunktionproblem on Sun, 24 Feb 2013 21:06:43 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>hab's nun endlich geschafft, nochmal hingesetzt und angesehen, siehe da: Der mir vorher völlig unbekannte Knackpunkt waren die &quot;&amp;&quot;-Zeichen!!!</p>
<p>Programm funktioniert nun hervorragend!</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;stdlib.h&gt;
using namespace std;

void beginn(float &amp;b, float &amp;d, float &amp;note);
void ausgabe(float &amp;e, float &amp;min, float &amp;max);

int main()
{
   float anzahl=0, max=0, min=1000, note,b,d,e; //Definition der verschiedenen Zahlenwerte (float)
   cout &lt;&lt; &quot;Geben Sie ein, wie viele Tests Sie bewerten wollen: &quot;; //Textausgabe
   cin &gt;&gt; anzahl; //Werteingabe

   do //Beginn der do-while Schleife
   {
     beginn(b,d,note);

     if (note&gt;max) //Wenn note&gt;max, Gleichsetzung
     {
     max=note;
     }

       if (note&lt;min) //Wenn note&lt;min, Gleichsetzung
       {
       min=note;
       }

   }

   while (b&lt;anzahl); //Bedingung und Aktionen von &quot;while&quot;

   e=d/anzahl; //Definition von e

   ausgabe(e,min,max);

return 0;
}

void beginn(float &amp;b, float &amp;d, float &amp;note)
      {
      cout &lt;&lt; &quot;Bitte Note eingeben: &quot;;
      b++;
      cin &gt;&gt; note; //Noteneingabe
      d=d+note;
      }

void ausgabe(float &amp;e, float &amp;min, float &amp;max)
        {
        cout &lt;&lt; &quot;Durchschnittsnote: &quot;&lt;&lt; e; //Ausgabe der errechneten Werte
        cout &lt;&lt; &quot;\nMax.: &quot; &lt;&lt; max;
        cout &lt;&lt; &quot;\nMin.: &quot; &lt;&lt; min;
        }
</code></pre>
<p>Danke für die Hilfe!</p>
<p>Hallohallo</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2301746</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2301746</guid><dc:creator><![CDATA[Hallohallo]]></dc:creator><pubDate>Sun, 24 Feb 2013 21:06:43 GMT</pubDate></item><item><title><![CDATA[Reply to Unterfunktionproblem on Sun, 24 Feb 2013 22:09:35 GMT]]></title><description><![CDATA[<p>Da ist ein Fehler drinnen, und ein krasser Schönheitsfehler.</p>
<p>Fehler: deine ganzen float Variablen sind nicht initialisiert. Wieso das trotzdem geht ist mir schleierhaft -- im Debug-Mode sollte dabei auf jeden Fall nur Unsinn rauskommen.</p>
<p>Krasser Schönheitsfehler: du verwendest floats als Zähler!?! Einmal der Schleifenzähler &quot;b&quot;. Dann &quot;anzahl&quot;, das zwar nicht selbst zählt, aber eben eine vom Benutzer eingegebene &quot;Anzahl&quot; darstellt.<br />
Das funktioniert zwar, aber man macht es einfach nicht.<br />
(Und bei der Eingabe kann der Benutzer dann als Anzahl 2,5 oder so eingeben -- was dann auch für die Division am Schluss übernommen wird -- vermutlich auch nicht in deinem Sinn)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2301767</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2301767</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Sun, 24 Feb 2013 22:09:35 GMT</pubDate></item></channel></rss>