<?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[Bitte um Hilfe]]></title><description><![CDATA[<p>Moin,</p>
<p>Ich beschäftige mich nun seit ein paar Tagen wieder mit C++, nachdem ich mein &quot;Jetzt lerne ich C++&quot; aus der Ecke hervor geholt habe.</p>
<p>Derzeit bin ich bei den Klassen und habe hier nun ein Problem, nicht etwa mit dem Programm selber sondern mit der Unzureichenden erklärung des Autors.</p>
<p>Leider wird in der Erklärung des Quellcodes zu keinem Zeitpunkt auf den Abschnitt über:</p>
<pre><code>void SetUpperLeft(Point Location) { itsUpperLeft = Location; }
      void SetLowerLeft(Point Location) { itsLowerLeft = Location; }
      void SetUpperRight(Point Location) { itsUpperRight = Location; }
      void SetLowerRight(Point Location) { itsLowerRight = Location; }
</code></pre>
<p>Eingegangen.</p>
<p>Nun würde ich aber gerne Wissen wofür das ganze da ist und wie man es benutzt. Ich habe nun schon seit gut einer halben Stunde versucht irgendwas damit zu machen oder herauszufinden wozu es den nun eigentlich da ist.</p>
<p>Großes Problem für mich ist, das ich nicht verstehe warum in SetUpperRight ein neues Point Objekt erstellt wird. Ich weiß leider auch nicht was bei<br />
itsUpperLeft = Location<br />
passiert.<br />
Da bisher auch noch nicht darauf eingegangen wurde was geschieht wen man einem Objekt ein anderes des selben Typs zuweist.</p>
<p>Werden dabei die werte von Location in itsUpperLeft kopiert?</p>
<p>Dabei frage ich mich dann, was daraus den Kopiert werden soll, den Location hat doch keine Werte zugewiesen bekommen.</p>
<pre><code>#include &lt;iostream.h&gt;

class Point 
{
      public:
      void SetX(int x) { itsX = x; }
      void SetY(int y) { itsY = y; }
      int GetX()const  { return itsX; }
      int GetY()const  { return itsX; }

      private:

      int itsX;
      int itsY;
};

class Rectangle
{
      public:
      Rectangle ( int top, int left, int bottom, int right);
      ~Rectangle () {}

      int GetTop() const { return itsTop; }
      int GetLeft() const { return itsLeft; }
      int GetBottom() const { return itsBottom; }
      int GetRight() const { return itsRight; }

      Point GetUpperLeft() const { return itsUpperLeft; }
      Point GetLowerLeft() const { return itsLowerLeft; }
      Point GetUpperRight() const { return itsUpperRight; }
      Point GetLowerRight() const { return itsLowerRight; }

      void SetUpperLeft(Point Location) { itsUpperLeft = Location; }
      void SetLowerLeft(Point Location) { itsLowerLeft = Location; }
      void SetUpperRight(Point Location) { itsUpperRight = Location; }
      void SetLowerRight(Point Location) { itsLowerRight = Location; }

      void SetTop(int top) { itsTop = top; }
      void SetLeft(int left) { itsLeft = left; }
      void SetBottom(int bottom) { itsBottom = bottom; }
      void SetRight(int right) { itsRight = right; }

      int GetArea() const  { 
                           int Width = itsRight-itsLeft;
                           int Height = itsTop-itsBottom;
                           return (Height * Width);
                           }

      private: 
      Point itsUpperLeft;
      Point itsLowerLeft;
      Point itsUpperRight;
      Point itsLowerRight;
      int itsTop;
      int itsBottom;
      int itsLeft;
      int itsRight;

      };
</code></pre>
<p>Hier der Code des Programms das die Klasse verwenden soll, vielleicht hilft euch das Nachzuvollziehen weshalb ich die funktionsweise der Klasse nicht komplett nachvollziehen kann.<br />
(Leider ist das auch schon das ende des Kaptiels über Klassen)</p>
<pre><code>#include &lt;cstdlib&gt;
#include &quot;rect.hpp&quot;
Rectangle::Rectangle(int top, int left, int bottom, int right)
{
                         itsTop = top;
                         itsLeft = left;
                         itsBottom = bottom;
                         itsRight = right;

                         itsUpperLeft.SetX(left);
                         itsUpperLeft.SetY(top);

                         itsUpperRight.SetX(right);
                         itsUpperRight.SetY(top);

                         itsLowerLeft.SetX(left);
                         itsLowerLeft.SetY(bottom);

                         itsLowerRight.SetX(right);
                         itsLowerRight.SetY(bottom);
}

using namespace std;

int main(int argc, char *argv[])
{

    int top=100,left=20,bottom=50,right=80;

    Rectangle MyRectangle (top, left, bottom, right );

    int Area = MyRectangle.GetArea();

    cout &lt;&lt; &quot;Flaeche: &quot; &lt;&lt; Area &lt;&lt; endl;
    cout &lt;&lt; &quot;Obere linke X-Koordinate: &quot;;
    cout &lt;&lt; MyRectangle.GetUpperLeft().GetX()&lt;&lt; endl;

        system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
}
</code></pre>
<p>Ich hoffe mal das ich mich jetzt nicht als kompletter voll idiot geoutet habe, also bitte habt Nachsicht mit einem blutigen Anfänger!</p>
<p>Gruß</p>
<p>Muffin</p>
<p>P.S</p>
<p>Ich habe mir noch wärend des Schreibens noch einige Gedanken über Location gemacht.</p>
<p>Ich vermute jetzt einfach mal, das einfach im Quellcode selbst ein Point Objekt deklariert wird, welches dann an SetUpperLeft übergeben wird. Demnach wäre Location einfach nur ein Parameter, wie bei einer variablen der dann bei verwendung der funktion durch das gewünschte objekt ersetzt wird.</p>
<p>Wen ich mit meinen Überlegungen jetzt richtig liege, stellt SetUpperLeft() eine Schnittstelle da mit der ich direkt auf itsUpperLeft zugreifen kann bzw. dem Objekt werte zuweisen kann. Mit hilfe eines Point Objekts kann ich dann die Werte Manipulieren und übergeben.</p>
<p>Was mich hierbei ein wenig ärgert ist das der Autor so etwas einführt es aber nicht weiter erklärt. Ich hab keine stelle gefunden in der Erklärt wurde was passiert wen man einer funktion ein Objekt übergibt bzw. das das möglich ist, und was bei Objekt1=Objekt2 passiert.</p>
<p>Ich hoffe mal das dabei später im buch bei Vererbung und Polymorphie auf dinge dieser art eingegangen werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/150815/bitte-um-hilfe</link><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Sep 2026 02:38:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/150815.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 20 Jun 2006 12:40:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 14:55:36 GMT]]></title><description><![CDATA[<p>Moin,</p>
<p>Ich beschäftige mich nun seit ein paar Tagen wieder mit C++, nachdem ich mein &quot;Jetzt lerne ich C++&quot; aus der Ecke hervor geholt habe.</p>
<p>Derzeit bin ich bei den Klassen und habe hier nun ein Problem, nicht etwa mit dem Programm selber sondern mit der Unzureichenden erklärung des Autors.</p>
<p>Leider wird in der Erklärung des Quellcodes zu keinem Zeitpunkt auf den Abschnitt über:</p>
<pre><code>void SetUpperLeft(Point Location) { itsUpperLeft = Location; }
      void SetLowerLeft(Point Location) { itsLowerLeft = Location; }
      void SetUpperRight(Point Location) { itsUpperRight = Location; }
      void SetLowerRight(Point Location) { itsLowerRight = Location; }
</code></pre>
<p>Eingegangen.</p>
<p>Nun würde ich aber gerne Wissen wofür das ganze da ist und wie man es benutzt. Ich habe nun schon seit gut einer halben Stunde versucht irgendwas damit zu machen oder herauszufinden wozu es den nun eigentlich da ist.</p>
<p>Großes Problem für mich ist, das ich nicht verstehe warum in SetUpperRight ein neues Point Objekt erstellt wird. Ich weiß leider auch nicht was bei<br />
itsUpperLeft = Location<br />
passiert.<br />
Da bisher auch noch nicht darauf eingegangen wurde was geschieht wen man einem Objekt ein anderes des selben Typs zuweist.</p>
<p>Werden dabei die werte von Location in itsUpperLeft kopiert?</p>
<p>Dabei frage ich mich dann, was daraus den Kopiert werden soll, den Location hat doch keine Werte zugewiesen bekommen.</p>
<pre><code>#include &lt;iostream.h&gt;

class Point 
{
      public:
      void SetX(int x) { itsX = x; }
      void SetY(int y) { itsY = y; }
      int GetX()const  { return itsX; }
      int GetY()const  { return itsX; }

      private:

      int itsX;
      int itsY;
};

class Rectangle
{
      public:
      Rectangle ( int top, int left, int bottom, int right);
      ~Rectangle () {}

      int GetTop() const { return itsTop; }
      int GetLeft() const { return itsLeft; }
      int GetBottom() const { return itsBottom; }
      int GetRight() const { return itsRight; }

      Point GetUpperLeft() const { return itsUpperLeft; }
      Point GetLowerLeft() const { return itsLowerLeft; }
      Point GetUpperRight() const { return itsUpperRight; }
      Point GetLowerRight() const { return itsLowerRight; }

      void SetUpperLeft(Point Location) { itsUpperLeft = Location; }
      void SetLowerLeft(Point Location) { itsLowerLeft = Location; }
      void SetUpperRight(Point Location) { itsUpperRight = Location; }
      void SetLowerRight(Point Location) { itsLowerRight = Location; }

      void SetTop(int top) { itsTop = top; }
      void SetLeft(int left) { itsLeft = left; }
      void SetBottom(int bottom) { itsBottom = bottom; }
      void SetRight(int right) { itsRight = right; }

      int GetArea() const  { 
                           int Width = itsRight-itsLeft;
                           int Height = itsTop-itsBottom;
                           return (Height * Width);
                           }

      private: 
      Point itsUpperLeft;
      Point itsLowerLeft;
      Point itsUpperRight;
      Point itsLowerRight;
      int itsTop;
      int itsBottom;
      int itsLeft;
      int itsRight;

      };
</code></pre>
<p>Hier der Code des Programms das die Klasse verwenden soll, vielleicht hilft euch das Nachzuvollziehen weshalb ich die funktionsweise der Klasse nicht komplett nachvollziehen kann.<br />
(Leider ist das auch schon das ende des Kaptiels über Klassen)</p>
<pre><code>#include &lt;cstdlib&gt;
#include &quot;rect.hpp&quot;
Rectangle::Rectangle(int top, int left, int bottom, int right)
{
                         itsTop = top;
                         itsLeft = left;
                         itsBottom = bottom;
                         itsRight = right;

                         itsUpperLeft.SetX(left);
                         itsUpperLeft.SetY(top);

                         itsUpperRight.SetX(right);
                         itsUpperRight.SetY(top);

                         itsLowerLeft.SetX(left);
                         itsLowerLeft.SetY(bottom);

                         itsLowerRight.SetX(right);
                         itsLowerRight.SetY(bottom);
}

using namespace std;

int main(int argc, char *argv[])
{

    int top=100,left=20,bottom=50,right=80;

    Rectangle MyRectangle (top, left, bottom, right );

    int Area = MyRectangle.GetArea();

    cout &lt;&lt; &quot;Flaeche: &quot; &lt;&lt; Area &lt;&lt; endl;
    cout &lt;&lt; &quot;Obere linke X-Koordinate: &quot;;
    cout &lt;&lt; MyRectangle.GetUpperLeft().GetX()&lt;&lt; endl;

        system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
}
</code></pre>
<p>Ich hoffe mal das ich mich jetzt nicht als kompletter voll idiot geoutet habe, also bitte habt Nachsicht mit einem blutigen Anfänger!</p>
<p>Gruß</p>
<p>Muffin</p>
<p>P.S</p>
<p>Ich habe mir noch wärend des Schreibens noch einige Gedanken über Location gemacht.</p>
<p>Ich vermute jetzt einfach mal, das einfach im Quellcode selbst ein Point Objekt deklariert wird, welches dann an SetUpperLeft übergeben wird. Demnach wäre Location einfach nur ein Parameter, wie bei einer variablen der dann bei verwendung der funktion durch das gewünschte objekt ersetzt wird.</p>
<p>Wen ich mit meinen Überlegungen jetzt richtig liege, stellt SetUpperLeft() eine Schnittstelle da mit der ich direkt auf itsUpperLeft zugreifen kann bzw. dem Objekt werte zuweisen kann. Mit hilfe eines Point Objekts kann ich dann die Werte Manipulieren und übergeben.</p>
<p>Was mich hierbei ein wenig ärgert ist das der Autor so etwas einführt es aber nicht weiter erklärt. Ich hab keine stelle gefunden in der Erklärt wurde was passiert wen man einer funktion ein Objekt übergibt bzw. das das möglich ist, und was bei Objekt1=Objekt2 passiert.</p>
<p>Ich hoffe mal das dabei später im buch bei Vererbung und Polymorphie auf dinge dieser art eingegangen werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1081394</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1081394</guid><dc:creator><![CDATA[Muffin888]]></dc:creator><pubDate>Thu, 22 Jun 2006 14:55:36 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Tue, 20 Jun 2006 12:49:42 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Ist doch wunderbar, dass du es alleine gelöst hast.</p>
<p>chrische</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1081405</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1081405</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 20 Jun 2006 12:49:42 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Tue, 20 Jun 2006 12:50:35 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Vermutlich ist es besser wenn du dir die <a href="http://tutorial.schornboeck.net/oop.htm" rel="nofollow">Grundlagen der OOP</a> anschaust.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1081406</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1081406</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Tue, 20 Jun 2006 12:50:35 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Tue, 20 Jun 2006 12:58:09 GMT]]></title><description><![CDATA[<p>chrische5 schrieb:</p>
<blockquote>
<p>Hallo</p>
<p>Ist doch wunderbar, dass du es alleine gelöst hast.</p>
<p>chrische</p>
</blockquote>
<p>Dem entnehme ich jetzt einfach mal das ich die Lösung wohl gefunden habe.</p>
<p>Ich möcht dabei mal auf eine Compiler Warnung zu sprechen kommen die mein dev-C++ immer ausgibt.</p>
<p>32:2 C:\Dev-Cpp\include\c++\3.4.2\backward\backward_warning.h #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the &lt;X&gt; header for the &lt;X.h&gt; header for C++ includes, or &lt;iostream&gt; instead of the deprecated header &lt;iostream.h&gt;. To disable this warning use -Wno-deprecated.</p>
<p>Ich kann damit jetzt nicht so richtig was anfangen, worüber beschwert er sich nun?</p>
<p>EDIT: Danke für den Link, das werd ich mal durch lesen!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1081417</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1081417</guid><dc:creator><![CDATA[Muffin888]]></dc:creator><pubDate>Tue, 20 Jun 2006 12:58:09 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Tue, 20 Jun 2006 13:01:29 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Mach mal das .h nach iostream weg. Schreib also einfach</p>
<pre><code class="language-cpp">#include &lt;iostraem&gt;
</code></pre>
<p>uns schreibst dann noch</p>
<pre><code class="language-cpp">using namespace std;
</code></pre>
<p>drunter und alles wird gut. Du kannst alternativ ber auch immer:</p>
<pre><code class="language-cpp">std::cout
</code></pre>
<p>und so weiter schreiben.</p>
<p>chrische</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1081429</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1081429</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 20 Jun 2006 13:01:29 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 14:48:19 GMT]]></title><description><![CDATA[<p>Erstmal vielen dank für die Hilfe.</p>
<p>Ich hab nun mal probeweise ein kleine Programm geschrieben und hab hier nun ein Problem, erstmal der Code:</p>
<pre><code>#include &lt;iostream&gt;
using namespace std;

class Ressourcen
{

                public:
                       Ressourcen (int Arbeiter);
                       ~Ressourcen() {}

                       int Metall(int Metall, int Arbeiter)
                       {
                         itsMetall = Metall; 
                         itsMetall = Arbeiter * 3;
                         return itsMetall;
                       }

                       int Sillizium(int Sillizium, int Arbeiter)
                       {
                          itsSillizium = Sillizium;
                          itsSillizium = Arbeiter * 2;
                          return itsSillizium;
                       }                                      

                       int Deuterium(int Deuterium, int Arbeiter)
                       {
                           itsDeuterium = Deuterium;
                           itsDeuterium = Arbeiter * 1;
                           return itsDeuterium;    
                       }

                       void SetArbeiter(int Arbeiter) 
                       { 
                          itsArbeiter=Arbeiter; 
                       }

                       int GetMetal() const { return itsMetall; }
                       int GetSillizium() const { return itsSillizium; }
                       int GetDeuterium() const { return itsDeuterium; }

                private:

                        int itsArbeiter;
                        int itsMetall;
                        int itsSillizium;
                        int itsDeuterium;
};

main()
{
      Ressourcen MyRessourcen(int Arbeiter);

      int Arbeiter;

      cin &gt;&gt;Arbeiter;
      MyRessourcen.SetArbeiter(int Arbeiter);

      return 0;
}
</code></pre>
<p>Wieso kann ich keine werte an SetArbeiter übergeben? Was mach ich den da falsch?</p>
<p>P.S</p>
<p>Ich habe mir mittlerweile das Tutorial ein wenig angesehen, und finde es im großen und ganzen garnicht schlecht, aber der Autor beschreibt kaum was er da gerade tut bzw. warum.</p>
<p>Ist das ganze eher ein Tutorial für fortgeschrittene?</p>
<p>Im großen und ganzen auf jedenfall sehr hilfreich! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1083058</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083058</guid><dc:creator><![CDATA[Muffin888]]></dc:creator><pubDate>Thu, 22 Jun 2006 14:48:19 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 15:30:27 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>Erstmal int main()...auch wenn dein Compiler int bei fehlendem Typen annimmt ist das nicht Standard!</p>
<p>so isses richtig (du hast Typen gesetz, wo keine hingehören):</p>
<pre><code class="language-cpp">int main()
{
      int iArbeiter, iAndererArbeiter;

      cin &gt;&gt; iArbeiter;
      Ressourcen MyRessourcen(iArbeiter);

      // ein anderer Arbeiter:
      cin &gt;&gt; iAndererArbeiter;

      MyRessourcen.SetArbeiter(iAndererArbeiter);

      return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1083114</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083114</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Thu, 22 Jun 2006 15:30:27 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 16:05:11 GMT]]></title><description><![CDATA[<p>Moin,</p>
<p>vielen dank für die schnelle hilfe, scheint nun soweit alles richtig zu sein, aber nun meckert der linker rum!</p>
<p>Fehlermeldung:<br />
[Linker error] undefined reference to `Ressourcen::Ressourcen(int)'<br />
ld returned 1 exit status</p>
<p>Ich verwende übrigens Dev_C++.</p>
<pre><code>#include &lt;iostream&gt;
using namespace std;

class Ressourcen
{

                public:
                       Ressourcen (int Arbeiter);
                       ~Ressourcen() {}

                       int Metall(int Metall, int Arbeiter)
                       {
                         itsMetall = Metall; 
                         itsMetall = Arbeiter * 3;
                         return itsMetall;
                       }

                       int Sillizium(int Sillizium, int Arbeiter)
                       {
                          itsSillizium = Sillizium;
                          itsSillizium = Arbeiter * 2;
                          return itsSillizium;
                       }                                      

                       int Deuterium(int Deuterium, int Arbeiter)
                       {
                           itsDeuterium = Deuterium;
                           itsDeuterium = Arbeiter * 1;
                           return itsDeuterium;    
                       }

                       void SetArbeiter(int Arbeiter) 
                       { 
                          itsArbeiter=Arbeiter; 
                       }

                       int GetMetal() const { return itsMetall; }
                       int GetSillizium() const { return itsSillizium; }
                       int GetDeuterium() const { return itsDeuterium; }

                private:

                        int itsArbeiter;
                        int itsMetall;
                        int itsSillizium;
                        int itsDeuterium;
};

int main()
{
      int ersterArbeiter, Arbeiter;

      cin &gt;&gt; ersterArbeiter;
      Ressourcen MyRessourcen(ersterArbeiter);

      cin &gt;&gt;Arbeiter;
      MyRessourcen.SetArbeiter(Arbeiter);

       system(&quot;PAUSE&quot;);
    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1083153</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083153</guid><dc:creator><![CDATA[Muffin888]]></dc:creator><pubDate>Thu, 22 Jun 2006 16:05:11 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 16:12:22 GMT]]></title><description><![CDATA[<p>Du hast den Konstruktor von Ressourcen ja auch nicht definiert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1083171</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083171</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 22 Jun 2006 16:12:22 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 16:14:23 GMT]]></title><description><![CDATA[<p>Braunstein schrieb:</p>
<blockquote>
<p>Du hast den Konstruktor von Ressourcen ja auch nicht definiert.</p>
</blockquote>
<p>lol, jo...<br />
Hab ich gar nicht drauf geachtet...also der muss so aussehen:</p>
<pre><code class="language-cpp">// in der Klasse unter public:
Ressourcen (int iArbeiter) { itsArbeiter = iArbeiter; }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1083173</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083173</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Thu, 22 Jun 2006 16:14:23 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 16:17:05 GMT]]></title><description><![CDATA[<p>Du hältst wohl nichts von Initialisierungslisten?</p>
<pre><code class="language-cpp">Ressourcen (int iArbeiter) : itsArbeiter(iArbeiter) {}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1083178</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083178</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 22 Jun 2006 16:17:05 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 16:21:20 GMT]]></title><description><![CDATA[<blockquote>
<p>Du hältst wohl nichts von Initialisierungslisten?</p>
</blockquote>
<p><strong>Elementinitialisierer</strong> heißen die...lol...ne halte ich nicht :p</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1083184</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083184</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Thu, 22 Jun 2006 16:21:20 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 16:25:37 GMT]]></title><description><![CDATA[<p><a href="http://tutorial.schornboeck.net/initliste.htm" rel="nofollow">Initialisierungsliste</a><br />
ändere deine Meinung lieber. Glaub mir, es ist besser so. <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/1083190</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083190</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 22 Jun 2006 16:25:37 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 16:32:43 GMT]]></title><description><![CDATA[<p>Hm also mein C++ Buch sagt: Elementinitialisierer...aber is summa sumarum auch wuRscht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1083204</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083204</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Thu, 22 Jun 2006 16:32:43 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 17:26:00 GMT]]></title><description><![CDATA[<p>Vielen dank für die Hilfe!</p>
<p>Nun läuft das ganze soweit, nur hab ich aus irgendeinem grund einen Pufferüberlauf <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="😞"
    /></p>
<p>Ich hab jetzt ne ganze weile versucht den fehler zu finden, aber ich kann ihn nirgends entdecken!</p>
<p>Hätte nicht gedacht das mir wen ich das gelernte mal anwende so viele fehler unterlaufen, wo es doch eigentlich etwas ganz simples ist <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>Ressourcen.hpp</p>
<pre><code>#include &lt;iostream&gt;
using namespace std;

class Ressourcen
{

                public:
                       Ressourcen::Ressourcen(int init_Arbeiter){ itsArbeiter=init_Arbeiter; }
                       ~Ressourcen() {};

                       int Metall()
                       {
                         int Metall = itsArbeiter;
                         itsMetall = (Metall * 3);
                         return itsMetall;
                       }

                       int Sillizium()
                       {
                          int Sillizium = itsArbeiter;
                          itsSillizium = (Sillizium * 2) ;
                          return itsSillizium;
                       }                                      

                       int Deuterium()
                       {
                           int Deuterium;
                           Deuterium = itsArbeiter;
                           itsDeuterium  = (Deuterium * 1);
                           return itsDeuterium;    
                       }

                       void SetArbeiter(int Arbeiter) 
                       { 
                          itsArbeiter=Arbeiter; 
                       }

                       int GetMetall() const { return itsMetall; }
                       int GetSillizium() const { return itsSillizium; }
                       int GetDeuterium() const { return itsDeuterium; }
                       int GetArbeiter() const { return itsArbeiter; }

                private:

                        int itsArbeiter;
                        int itsMetall;
                        int itsSillizium;
                        int itsDeuterium;
};
</code></pre>
<p>Ressourcen.cpp</p>
<pre><code>#include &quot;Ressourcen.hpp&quot;

int main()
{

int init_Arbeiter;

 cout &lt;&lt; &quot;Geben sie die Anzahl der Arbeiter ein: &quot;;
 cin &gt;&gt; init_Arbeiter;
 Ressourcen MyRessourcen(init_Arbeiter);

     cout &lt;&lt; &quot;Ihre Arbeiter erwirtschaften &quot; &lt;&lt; MyRessourcen.GetMetall() &lt;&lt;&quot; Metall, &quot;;
     cout &lt;&lt; MyRessourcen.GetSillizium() &lt;&lt; &quot; Sillizium, und \n&quot; &lt;&lt; MyRessourcen.GetDeuterium()&lt;&lt; &quot; Deuterium.&quot; &lt;&lt; endl;
     cout &lt;&lt; &quot;Anzahl der Arbeiter: &quot; &lt;&lt; MyRessourcen.GetArbeiter() &lt;&lt;endl;
     system(&quot;PAUSE&quot;);
    return 0;
}
</code></pre>
<p>P.S</p>
<p>Der Pufferüberlauf betrifft nur die Ressourcen, itsArbeiter bleibt unverändert bei dem was ich über cin eingebe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1083262</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083262</guid><dc:creator><![CDATA[Muffin888]]></dc:creator><pubDate>Thu, 22 Jun 2006 17:26:00 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 17:31:10 GMT]]></title><description><![CDATA[<p>Also ersten weiß ich nicht, ob wir unter Pufferüberlauf das gleiche verstehen, und zweitens ist es sinnvoller, da man einen Pufferüberlauf (=Speicherzugriffsverletzung) so sehr schwer erkennen kann, wenn du mit nem Debugger ans Werk gehst...Beschreib mal deinen Fehler genauer <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>Wo tritt der Fehler genau auf ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1083267</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083267</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Thu, 22 Jun 2006 17:31:10 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 17:34:24 GMT]]></title><description><![CDATA[<p>Hehe, ok <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>Also der Wertebereich wird überschritten, so wie es aussieht.</p>
<p>Geben sie die Anzahl der Arbeiter ein: 100<br />
Ihre Arbeiter erwirtschaften 2008948848 Metall, -1 Sillizium, und<br />
2009055971 Deuterium.<br />
Anzahl der Arbeiter: 100<br />
Drücken Sie eine beliebige Taste . . .</p>
<p>Ich hab schon nach nem debugger gesucht, aber entweder ich bin blind oder da gibts keinen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1083272</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083272</guid><dc:creator><![CDATA[Muffin888]]></dc:creator><pubDate>Thu, 22 Jun 2006 17:34:24 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 18:05:05 GMT]]></title><description><![CDATA[<blockquote>
<p>Ich hab schon nach nem debugger gesucht, aber entweder ich bin blind oder da gibts keinen</p>
</blockquote>
<p>Welchen Compiler hasse denn ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1083293</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083293</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Thu, 22 Jun 2006 18:05:05 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 18:13:42 GMT]]></title><description><![CDATA[<p>Bloodshed Dev-C++ <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/1083300</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083300</guid><dc:creator><![CDATA[Muffin888]]></dc:creator><pubDate>Thu, 22 Jun 2006 18:13:42 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 18:15:53 GMT]]></title><description><![CDATA[<p>Vielleicht solltest du die internen Variablen auch mal initialisieren. In denen steht jetzt nämlich nur Müll drin. Wozu hast du diese anderen Funktionen erzeugt (Deuterium() usw.). Aufrufen tust du sie ja nicht.<br />
PS. Silizium schreibt man mit einem l.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1083303</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083303</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 22 Jun 2006 18:15:53 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 18:21:20 GMT]]></title><description><![CDATA[<p>ach mist, ich hab die funktionen im programm code nicht aufgerufen.</p>
<p>Da rächt es sich das ich so früh angefangen hab was zu versuchen. Dachte doch glatt das das auch so automatisch berechnet wird.</p>
<pre><code>#include &quot;Ressourcen.hpp&quot;

int main()
{

int init_Arbeiter;

 cout &lt;&lt; &quot;Geben sie die Anzahl der Arbeiter ein: &quot;;
 cin &gt;&gt; init_Arbeiter;
 Ressourcen MyRessourcen(init_Arbeiter);

    MyRessourcen.Metall();
    MyRessourcen.Deuterium();
    MyRessourcen.Sillizium();
     cout &lt;&lt; &quot;Ihre Arbeiter erwirtschaften &quot; &lt;&lt; MyRessourcen.GetMetall() &lt;&lt;&quot; Metall, &quot;;
     cout &lt;&lt; MyRessourcen.GetSillizium() &lt;&lt; &quot; Sillizium, und \n&quot; &lt;&lt; MyRessourcen.GetDeuterium()&lt;&lt; &quot; Deuterium.&quot; &lt;&lt; endl;
     cout &lt;&lt; &quot;Anzahl der Arbeiter: &quot; &lt;&lt; MyRessourcen.GetArbeiter() &lt;&lt;endl;
     system(&quot;PAUSE&quot;);
    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1083308</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083308</guid><dc:creator><![CDATA[Muffin888]]></dc:creator><pubDate>Thu, 22 Jun 2006 18:21:20 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 18:24:02 GMT]]></title><description><![CDATA[<p>Warum sollten die automatisch aufgerufen werden. Mein Tipp, schmeiß diese Funktionen raus oder mach sie zumindest private und initialisiere deine Variablen im Konstruktor sowie in SetArbeiter.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1083312</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083312</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 22 Jun 2006 18:24:02 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 18:36:00 GMT]]></title><description><![CDATA[<p>Vielen dank für eure Hilfe!</p>
<p>Ich werde jetzt erstmal weiterlernen und dann demnächst das ganze mal besser machen, das war ja nur ein erster praxistest ob ich mit dem was ich gelernt habe schon was anfangen kann und vor allem ob ich mit den klassen den auch umgehen kann.</p>
<p>Das ganze hat mir gezeigt das ich noch ne menge lernen muss, und das werde ich auch tun <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>Aber wenigstens gibts hier ein Forum, das einem mit rat und tat zur seite steht.</p>
<p>Schönen Abend wünsch ich!</p>
<p>muffin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1083324</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083324</guid><dc:creator><![CDATA[Muffin888]]></dc:creator><pubDate>Thu, 22 Jun 2006 18:36:00 GMT</pubDate></item><item><title><![CDATA[Reply to Bitte um Hilfe on Thu, 22 Jun 2006 18:52:42 GMT]]></title><description><![CDATA[<p>Muffin888 schrieb:</p>
<blockquote>
<p>Das ganze hat mir gezeigt das ich noch ne menge lernen muss, und das werde ich auch tun <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>
</blockquote>
<p>TOP!, Hut Ab! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1083335</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083335</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Thu, 22 Jun 2006 18:52:42 GMT</pubDate></item></channel></rss>