<?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[Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab]]></title><description><![CDATA[<p>Erst mal der Code von der Datei die nicht eingebunden werden kann</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;Game.cpp&quot;

using namespace std;

class CRaumschiff
{
      public:

             int Energie;
             int Geschwindigkeit;
             //CGame *pRaumschiffauswahl;

//Zeige Daten
//
//Aufgabe: Daten des Raumschiffes Zeigen
//
 void ZeigeDaten ()
             {
                  cout &lt;&lt; &quot;Energie&quot; &lt;&lt; Energie &lt;&lt;&quot;!\n&quot;;
                  cout &lt;&lt; &quot;Geschwindigkeit&quot; &lt;&lt; Geschwindigkeit &lt;&lt; &quot;!\n&quot;;
               //   cout &lt;&lt; &quot;Raumschiffauswahl&quot; &lt;&lt; pRaumschiffauswahl &lt;&lt; endl;
             }

};
</code></pre>
<p>Kaum versuche ich diese Datei in die Datei main.cpp einzubinden bleigt der Compieler hängen u. reagiert nicht mehr!<br />
Kann mir jemand helfen?<br />
Hier noch die main.cpp Datei</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;Game.cpp&quot;
#include &quot;Raumschiff.cpp&quot;

using namespace std;

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

    char Auswahl;
    cout &lt;&lt; &quot;Hallo, willkommen bei dem VERSUCH \n&quot;;
    cout &lt;&lt; &quot;Du wirst nun eine Waffe waehlen muessen\n&quot;;
    cout &lt;&lt; &quot;los gehts\n&quot;;
    cout &lt;&lt; &quot;Um das Spiel zu starten bitte (s)tart\n&quot;;
    cout &lt;&lt; &quot;Um das Spiel zu beenden bitte (b)eenden\n&quot;;
    do
    {
    if (Auswahl != 's' &amp;&amp; Auswahl != 'S' &amp;&amp; Auswahl != 'B' &amp;&amp; Auswahl != 'b')
       cin  &gt;&gt; Auswahl;
       if (Auswahl != 's' &amp;&amp; Auswahl != 'S' &amp;&amp; Auswahl != 'B' &amp;&amp; Auswahl != 'b')
               cout &lt;&lt; &quot;Falsche eingabe \n&quot;;
    if (Auswahl == 's' || Auswahl == 'S')
       {
       cout &lt;&lt; &quot;Los gehts\n&quot;;
    //Hier kommt das Hauptprogramm:
    //
    //
    //Start:

    CGame Game;
    Game.aufgehts()   ; 
  //  CRaumschiff Raumschiff1
  //  Raumschiff1.Zeige Daten ();
}
    else if (Auswahl == 'b' || Auswahl == 'B')
       cout &lt;&lt; &quot;Dann halt nicht\n&quot;;
    }while (Auswahl != 's' &amp;&amp; Auswahl != 'S' &amp;&amp; Auswahl != 'B' &amp;&amp; Auswahl != 'b');

    system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
    //return 0;
}
</code></pre>
<p>und vollständigkeitshalber auch die letzte (Game.cpp) Datei</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
//#include &quot;Raumschiff.cpp&quot;

using namespace std;

class CGame
{
      public:

             char Raumschiffauswahl;

             void aufgehts ()
             {
                   cout &lt;&lt; &quot;Waehlen sie die Daten fuer ihr Raumschiff&quot; &lt;&lt; endl;
                   cout &lt;&lt; &quot;Fuer ein schnelles Raumschiff druecken sie (s)chnell&quot; &lt;&lt; endl;
                   cout &lt;&lt; &quot;Fuer ein grosses Raumschiff druecken sie (b)ig&quot; &lt;&lt; endl;
                   do
                     {
                      if (Raumschiffauswahl != 's' &amp;&amp; Raumschiffauswahl != 'S' &amp;&amp; Raumschiffauswahl != 'B' &amp;&amp; Raumschiffauswahl != 'b')
                         cin  &gt;&gt; Raumschiffauswahl;
                              if (Raumschiffauswahl != 's' &amp;&amp; Raumschiffauswahl != 'S' &amp;&amp; Raumschiffauswahl != 'B' &amp;&amp; Raumschiffauswahl != 'b')
                                 cout &lt;&lt; &quot;Falsche eingabe \n&quot;;
                      }while (Raumschiffauswahl != 's' &amp;&amp; Raumschiffauswahl != 'S' &amp;&amp; Raumschiffauswahl != 'B' &amp;&amp; Raumschiffauswahl != 'b');
                   //CRaumschiff Raumschiff1;
                   //Raumschiff1.ZeigeDaten ;                  
             }

};
</code></pre>
<p>So funktioniert das Programm einwandfrei da die Klasse CRaumschiff nicht angerührt wird aber kaum will ich sie einbinden ...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/187069/datei-kann-nicht-quot-includeed-quot-werden-compiler-stürtz-ab</link><generator>RSS for Node</generator><lastBuildDate>Thu, 24 Sep 2026 14:24:00 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/187069.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 15 Jul 2007 13:22:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab on Sun, 15 Jul 2007 13:22:18 GMT]]></title><description><![CDATA[<p>Erst mal der Code von der Datei die nicht eingebunden werden kann</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;Game.cpp&quot;

using namespace std;

class CRaumschiff
{
      public:

             int Energie;
             int Geschwindigkeit;
             //CGame *pRaumschiffauswahl;

//Zeige Daten
//
//Aufgabe: Daten des Raumschiffes Zeigen
//
 void ZeigeDaten ()
             {
                  cout &lt;&lt; &quot;Energie&quot; &lt;&lt; Energie &lt;&lt;&quot;!\n&quot;;
                  cout &lt;&lt; &quot;Geschwindigkeit&quot; &lt;&lt; Geschwindigkeit &lt;&lt; &quot;!\n&quot;;
               //   cout &lt;&lt; &quot;Raumschiffauswahl&quot; &lt;&lt; pRaumschiffauswahl &lt;&lt; endl;
             }

};
</code></pre>
<p>Kaum versuche ich diese Datei in die Datei main.cpp einzubinden bleigt der Compieler hängen u. reagiert nicht mehr!<br />
Kann mir jemand helfen?<br />
Hier noch die main.cpp Datei</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;Game.cpp&quot;
#include &quot;Raumschiff.cpp&quot;

using namespace std;

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

    char Auswahl;
    cout &lt;&lt; &quot;Hallo, willkommen bei dem VERSUCH \n&quot;;
    cout &lt;&lt; &quot;Du wirst nun eine Waffe waehlen muessen\n&quot;;
    cout &lt;&lt; &quot;los gehts\n&quot;;
    cout &lt;&lt; &quot;Um das Spiel zu starten bitte (s)tart\n&quot;;
    cout &lt;&lt; &quot;Um das Spiel zu beenden bitte (b)eenden\n&quot;;
    do
    {
    if (Auswahl != 's' &amp;&amp; Auswahl != 'S' &amp;&amp; Auswahl != 'B' &amp;&amp; Auswahl != 'b')
       cin  &gt;&gt; Auswahl;
       if (Auswahl != 's' &amp;&amp; Auswahl != 'S' &amp;&amp; Auswahl != 'B' &amp;&amp; Auswahl != 'b')
               cout &lt;&lt; &quot;Falsche eingabe \n&quot;;
    if (Auswahl == 's' || Auswahl == 'S')
       {
       cout &lt;&lt; &quot;Los gehts\n&quot;;
    //Hier kommt das Hauptprogramm:
    //
    //
    //Start:

    CGame Game;
    Game.aufgehts()   ; 
  //  CRaumschiff Raumschiff1
  //  Raumschiff1.Zeige Daten ();
}
    else if (Auswahl == 'b' || Auswahl == 'B')
       cout &lt;&lt; &quot;Dann halt nicht\n&quot;;
    }while (Auswahl != 's' &amp;&amp; Auswahl != 'S' &amp;&amp; Auswahl != 'B' &amp;&amp; Auswahl != 'b');

    system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
    //return 0;
}
</code></pre>
<p>und vollständigkeitshalber auch die letzte (Game.cpp) Datei</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
//#include &quot;Raumschiff.cpp&quot;

using namespace std;

class CGame
{
      public:

             char Raumschiffauswahl;

             void aufgehts ()
             {
                   cout &lt;&lt; &quot;Waehlen sie die Daten fuer ihr Raumschiff&quot; &lt;&lt; endl;
                   cout &lt;&lt; &quot;Fuer ein schnelles Raumschiff druecken sie (s)chnell&quot; &lt;&lt; endl;
                   cout &lt;&lt; &quot;Fuer ein grosses Raumschiff druecken sie (b)ig&quot; &lt;&lt; endl;
                   do
                     {
                      if (Raumschiffauswahl != 's' &amp;&amp; Raumschiffauswahl != 'S' &amp;&amp; Raumschiffauswahl != 'B' &amp;&amp; Raumschiffauswahl != 'b')
                         cin  &gt;&gt; Raumschiffauswahl;
                              if (Raumschiffauswahl != 's' &amp;&amp; Raumschiffauswahl != 'S' &amp;&amp; Raumschiffauswahl != 'B' &amp;&amp; Raumschiffauswahl != 'b')
                                 cout &lt;&lt; &quot;Falsche eingabe \n&quot;;
                      }while (Raumschiffauswahl != 's' &amp;&amp; Raumschiffauswahl != 'S' &amp;&amp; Raumschiffauswahl != 'B' &amp;&amp; Raumschiffauswahl != 'b');
                   //CRaumschiff Raumschiff1;
                   //Raumschiff1.ZeigeDaten ;                  
             }

};
</code></pre>
<p>So funktioniert das Programm einwandfrei da die Klasse CRaumschiff nicht angerührt wird aber kaum will ich sie einbinden ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1325847</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1325847</guid><dc:creator><![CDATA[greece57]]></dc:creator><pubDate>Sun, 15 Jul 2007 13:22:18 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab on Sun, 15 Jul 2007 13:28:58 GMT]]></title><description><![CDATA[<p>klassen definiert man in headerdateien <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_tongue"
      title=":P"
      alt="😛"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1325852</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1325852</guid><dc:creator><![CDATA[pixartist]]></dc:creator><pubDate>Sun, 15 Jul 2007 13:28:58 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab on Sun, 15 Jul 2007 13:32:20 GMT]]></title><description><![CDATA[<p>Man sollte auch .cpp-Dateien nicht includen, sondern nur die dazu gehörigen header.</p>
<p>Die .cpp sollte man dann seperat kompilieren und später zusammen-linken.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1325854</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1325854</guid><dc:creator><![CDATA[The-Kenny]]></dc:creator><pubDate>Sun, 15 Jul 2007 13:32:20 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab on Sun, 15 Jul 2007 13:58:57 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#if !defined SPACE_SHIP_H__INCLUDED
#define SPACE_SHIP_H__INCLUDED

#if (_MSC_VER &gt; 1000)
#pragma once
#endif // _MSC_VER &gt; 1000

#include &lt;iostream&gt;
#include &lt;string&gt;

// using namespace std; niemals in einem HEADER!

class SpaceShip
{
public:
    SpaceShip() : m_energie(0), m_speed(0) {}
private:
    unsigned short m_energie;
    unsigned int m_speed;
    std::string m_name;

public:
    void show_energie() const { std::cout &lt;&lt; &quot;- Energie: &quot; &lt;&lt; m_energie &lt;&lt; std::endl; }
    void show_speed() const { std::cout &lt;&lt; &quot;- Geschwindigkeit: &quot; &lt;&lt; m_speed &lt;&lt; std::endl; }
    void show_data() const { std::cout &lt;&lt; &quot;.&quot; &lt;&lt; m_name &lt;&lt; &quot;: &quot; &lt;&lt; std::endl; show_energie(); show_speed(); }
};

#endif // SPACE_SHIP_H__INCLUDED
</code></pre>
<p>...</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;Game.h&quot;
#include &quot;spaceship.h&quot;

int main()
{
    bool close = false;
    while (close == false)
    {
        std::cout &lt;&lt; &quot;Versuch V0.1BETA&quot; &lt;&lt; std::endl;
        std::cout &lt;&lt; &quot;(1) Starten&quot; &lt;&lt; std::endl;
        std::cout &lt;&lt; &quot;(2) Beenden&quot; &lt;&lt; std::endl;

        unsigned short sel = 0;
        while (!(std::cin &gt;&gt; sel) || sel &gt; 2 || sel &lt; 1) { std::cin.clear(); std::cin.ignore(std::numeric_limits&lt;std::streamsize&gt;::max(), '\n'); }
        switch (sel)
        {
        case 1: 
        { /* mach halt was */ } break;
        case 2:
        { close = true; } break;
        }
    }
    /*
    std::cin.clear();    
    std::cin.ignore(std::numeric_limits&lt;std::streamsize&gt;::max(), '\n');
    std::cin.get(); */ // anstelle von std::system(&quot;pause&quot;); ... viel besser! 
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1325868</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1325868</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sun, 15 Jul 2007 13:58:57 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab on Sun, 15 Jul 2007 14:15:00 GMT]]></title><description><![CDATA[<p>Des mit den hpp Dateien wusste ich aber ürgendwie funktioniert das nicht mit Dev C++!<br />
Kann mir da jemand helfen wie ich des da schaffe!<br />
Danke für die bisjetzt angekommen antworten</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1325889</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1325889</guid><dc:creator><![CDATA[greece57]]></dc:creator><pubDate>Sun, 15 Jul 2007 14:15:00 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab on Sun, 15 Jul 2007 14:22:29 GMT]]></title><description><![CDATA[<p>Wo ist dein Problem? Leg eine Datei &quot;spaceship.h&quot; an und pack da den 1. Code rein den ich gepostet hab. Dann eine Datei &quot;main.cpp&quot; wo du den 2. reinpackst. Eine 3. Datei namens &quot;game.h&quot; wo du dann deine Game-Klasse reinpackst. Das alles fügst du dann zu deinem Projekt hinzu... achja ... nimm lieber Visual C++ 2005 Express Edition ... ist auch kostenlos und einfacher zu nutzen als auch besser ^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1325895</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1325895</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sun, 15 Jul 2007 14:22:29 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab on Sun, 15 Jul 2007 14:25:11 GMT]]></title><description><![CDATA[<p>ne ich bin dagegen (siehe meine Signatur)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1325899</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1325899</guid><dc:creator><![CDATA[Krux]]></dc:creator><pubDate>Sun, 15 Jul 2007 14:25:11 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab on Sun, 15 Jul 2007 14:25:56 GMT]]></title><description><![CDATA[<p>Krux schrieb:</p>
<blockquote>
<p>ne ich bin dagegen (siehe meine Signatur)</p>
</blockquote>
<p>Code::Blocks mit aktuellem MinGW...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1325900</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1325900</guid><dc:creator><![CDATA[The-Kenny]]></dc:creator><pubDate>Sun, 15 Jul 2007 14:25:56 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab on Sun, 15 Jul 2007 14:28:00 GMT]]></title><description><![CDATA[<p>Hab keine Orig. version nur Authoren also -&gt; keine Exe <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/1325903</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1325903</guid><dc:creator><![CDATA[greece57]]></dc:creator><pubDate>Sun, 15 Jul 2007 14:28:00 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab on Sun, 15 Jul 2007 14:29:20 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/11517">@Krux</a>: Begründung?<br />
<a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/16655">@greece57</a>: Solange Krux keine sinnvolle Begründung gibt, warum du nicht Microsoft Visual C++ 2005 Express Edition nutzen solltest, würde ich dir empfehlen umzusteigen!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1325905</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1325905</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sun, 15 Jul 2007 14:29:20 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab on Sun, 15 Jul 2007 14:44:22 GMT]]></title><description><![CDATA[<p>Danke (:<br />
Ne ich wills halt combilen! u. das geht mit der authoren version</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1325916</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1325916</guid><dc:creator><![CDATA[greece57]]></dc:creator><pubDate>Sun, 15 Jul 2007 14:44:22 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab on Sun, 15 Jul 2007 14:58:27 GMT]]></title><description><![CDATA[<p><a href="http://msdn.microsoft.com/vstudio/express/downloads/default.aspx" rel="nofollow">http://msdn.microsoft.com/vstudio/express/downloads/default.aspx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1325925</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1325925</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sun, 15 Jul 2007 14:58:27 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab on Sun, 15 Jul 2007 14:59:12 GMT]]></title><description><![CDATA[<p>danke!<br />
Warum geht das nicht?:</p>
<pre><code class="language-cpp">case 1: 
        { 
          CGame Game;
          Game.aufgehts();
          CSpaceship Spaceship;
          Spaceship show_energie();
        } break;
</code></pre>
<p>Ich will die Funktion show_energie aufrufen wie mach ich das?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1325927</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1325927</guid><dc:creator><![CDATA[greece57]]></dc:creator><pubDate>Sun, 15 Jul 2007 14:59:12 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab on Sun, 15 Jul 2007 15:16:41 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">Spaceship.show_energie();
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1325942</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1325942</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sun, 15 Jul 2007 15:16:41 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab on Sun, 15 Jul 2007 15:20:19 GMT]]></title><description><![CDATA[<p>geht nicht<br />
Spaceship.show_energie();</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1325947</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1325947</guid><dc:creator><![CDATA[greece57]]></dc:creator><pubDate>Sun, 15 Jul 2007 15:20:19 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab on Sun, 15 Jul 2007 15:50:41 GMT]]></title><description><![CDATA[<p>in deinem Code auf der ersten Seite gibt es auch keine Funktion &quot;show_energie()&quot;, du musst sie schon deklarieren und implementieren.</p>
<p>FEHLERMELDUNGEN MITPOSTEN<br />
&quot;GEHT NICHT&quot; IST KEINE FEHLERMELDUNG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1325964</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1325964</guid><dc:creator><![CDATA[darthdespotism]]></dc:creator><pubDate>Sun, 15 Jul 2007 15:50:41 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab on Sun, 15 Jul 2007 17:14:29 GMT]]></title><description><![CDATA[<p>doch ich hab ja den von Evil korrigierten code genommen!!<br />
Fehlermeldung kommt gleich</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1326009</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1326009</guid><dc:creator><![CDATA[greece57]]></dc:creator><pubDate>Sun, 15 Jul 2007 17:14:29 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab on Sun, 15 Jul 2007 17:59:54 GMT]]></title><description><![CDATA[<p>So ich hab die Fehler jetzt bereinigt aber wie ist es so schön?<br />
Genau<br />
Kommt gleich ein neues Problem:<br />
Wie kann ich die Variable</p>
<pre><code>Raumschiffauswahl
</code></pre>
<p>in SpaceShip.h verwenden?<br />
hier ist Game.h:</p>
<pre><code class="language-cpp">#if !defined GAME_H__INCLUDED 
#define GAME_H__INCLUDED 

#if (_MSC_VER &gt; 1000) 
#pragma once 
#endif // _MSC_VER &gt; 1000 

#include &lt;iostream&gt; 
#include &lt;string&gt; 

class Game
{
      public:

             char Raumschiffauswahl;

             void aufgehts ()
             {
                  std::cout &lt;&lt; &quot;Waehlen sie die Daten fuer ihr Raumschiff&quot; &lt;&lt; std::endl;
                  std::cout &lt;&lt; &quot;Fuer ein schnelles Raumschiff druecken sie (s)chnell&quot; &lt;&lt; std::endl;
                  std::cout &lt;&lt; &quot;Fuer ein grosses Raumschiff druecken sie (b)ig&quot; &lt;&lt; std::endl;
                   do
                     {
                      if (Raumschiffauswahl != 's' &amp;&amp; Raumschiffauswahl != 'S' &amp;&amp; Raumschiffauswahl != 'B' &amp;&amp; Raumschiffauswahl != 'b')
                         std::cin  &gt;&gt; Raumschiffauswahl;
                              if (Raumschiffauswahl != 's' &amp;&amp; Raumschiffauswahl != 'S' &amp;&amp; Raumschiffauswahl != 'B' &amp;&amp; Raumschiffauswahl != 'b')
                                 std::cout &lt;&lt; &quot;Falsche eingabe&quot; &lt;&lt; std::endl;
                      }while (Raumschiffauswahl != 's' &amp;&amp; Raumschiffauswahl != 'S' &amp;&amp; Raumschiffauswahl != 'B' &amp;&amp; Raumschiffauswahl != 'b');
             }

};
#endif // GAME_H__INCLUDED
</code></pre>
<p>und hier ist SpaceShip.h:</p>
<pre><code>#if !defined SPACE_SHIP_H__INCLUDED 
#define SPACE_SHIP_H__INCLUDED 

#if (_MSC_VER &gt; 1000) 
#pragma once 
#endif // _MSC_VER &gt; 1000 

#include &lt;iostream&gt; 
#include &lt;string&gt; 
#include &quot;game.h&quot;

// using namespace std; niemals in einem HEADER! 

class SpaceShip 
{ 
public: 
    SpaceShip() : m_energie(0), m_speed(0) {} 
private: 
    unsigned short m_energie; 
    unsigned int m_speed; 
    std::string m_name; 
    Game *pRaumschiffauswahl;

public: 
    void UpdateSpaceShip ()
    {
         if (*pRaumschiffauswahl == 's' || *pRaumschiffauswahl == 'S')
            {
            m_energie = 100;
            m_speed = 500;
            }
         else if (*pRaumschiffauswahl == 'b' || *pRaumschiffauswahl == 'B')
             {
              m_energie = 500;
              m_speed = 100;
              }
         else
              std::cout &lt;&lt; &quot;Falsche Eingabe&quot; &lt;&lt; std::endl;
    }
    void show_energie() const { std::cout &lt;&lt; &quot;- Energie: &quot; &lt;&lt; m_energie &lt;&lt; &quot;km/h&quot; &lt;&lt; std::endl; } 
    void show_speed() const { std::cout &lt;&lt; &quot;- Geschwindigkeit: &quot; &lt;&lt; m_speed &lt;&lt; std::endl; } 
    void show_data() const { std::cout &lt;&lt; &quot;.&quot; &lt;&lt; m_name &lt;&lt; &quot;: &quot; &lt;&lt; std::endl; show_energie(); show_speed(); }
}; 

#endif // SPACE_SHIP_H__INCLUDED
</code></pre>
<p>Hier taucht der Fehler auf:<br />
no match for 'operator==' in <em>((SpaceShip</em>)this)-&gt;SpaceShip::pRaumschiffauswahl == 's'</p>
<p>das gleiche für 'S' ; 'b' und 'B'</p>
<p>und wenn ich die Zeile so schreibe was meiner Meinung nach eigentlich kompletter blödsinn ist:</p>
<pre><code class="language-cpp">if (SpaceShip::pRaumschiffauswahl == 's' || SpaceShip::pRaumschiffauswahl == 'S')
</code></pre>
<p>kommt der Fehler<br />
ISO C++ forbids comparison between pointer and integer</p>
<p>Bitte helft mir</p>
<p>AJA falls ich es so schreibe</p>
<pre><code class="language-cpp">char *pRaumschiffauswahl;

public: 
    void UpdateSpaceShip ()
    {
         if (*pRaumschiffauswahl == 's' || *pRaumschiffauswahl == 'S')
            {
            m_energie = 100;
            m_speed = 500;
            }
         else if (*pRaumschiffauswahl == 'b' || *pRaumschiffauswahl == 'B')
             {
              m_energie = 500;
              m_speed = 100;
              }
         else
              std::cout &lt;&lt; &quot;Falsche Eingabe&quot; &lt;&lt; std::endl;
    }
</code></pre>
<p>geht es zwar aber er geht in die else schleife:</p>
<pre><code>std::cout &lt;&lt; &quot;Falsche Eingabe&quot; &lt;&lt; std::cout;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1326038</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1326038</guid><dc:creator><![CDATA[greece57]]></dc:creator><pubDate>Sun, 15 Jul 2007 17:59:54 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kann nicht &amp;quot;includeed&amp;quot; werden! Compiler stürtz ab on Sun, 15 Jul 2007 18:30:47 GMT]]></title><description><![CDATA[<p>Krux schrieb:</p>
<blockquote>
<p>ne ich bin dagegen (siehe meine Signatur)</p>
</blockquote>
<p>Wenn Du es denn wenigstens endlich mal korrekt schreiben würdest. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_down"
      title=":-1:"
      alt="👎"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1326046</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1326046</guid><dc:creator><![CDATA[Konrad Rudolph]]></dc:creator><pubDate>Sun, 15 Jul 2007 18:30:47 GMT</pubDate></item></channel></rss>