<?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[&amp;quot;warnings&amp;quot; im Code : Kein Zeilenumbruch bei Vollbild]]></title><description><![CDATA[<p>Vll. kann sich jemand ja noch an meinen Weltraumvernichtungssimulator erinnern, um denn geht es jetzt nämlich. Und zwar gibts n paar warnings, aber ich weiß nicht genau warum.</p>
<p>main.cpp</p>
<pre><code class="language-cpp">#include &quot;game.hpp&quot;
#include &quot;operators.hpp&quot;
#include &quot;events.hpp&quot;
#include &quot;ic.hpp&quot;

using namespace std;
using namespace ic;
using namespace shorties;

int main()
{
    con.enableWndFSMode();
    game wus;
    wus.run();
    int counter=0;
    while(1)
    {
            if (counter&lt;wus.get_vector())
            { 
                wus.set_story(counter);
                ++counter;
            }
    }

    return 0;
}
</code></pre>
<p>game.hpp</p>
<pre><code class="language-cpp">#ifndef INCLUDE_GAME_HPP
#define INCLUDE_GAME_HPP

#include &lt;vector&gt;
#include &lt;string&gt;
#include &lt;limits&gt;

class game
{
    public:

    game();
    ~game();
    struct part
    {
        const game * get_parent() const {return m_parent;}
        std::string m_question[3], m_a, m_b, m_c, m_effect[3];
        part(const game *parent_,
             const std::string&amp; question1_,const std::string&amp; question2_,const std::string&amp; question3_,
             const std::string&amp; a_,const std::string&amp; b_,const std::string&amp; c_,
             const std::string&amp; effect1_,const std::string&amp; effect2_,const std::string&amp; effect3_);
        private:
        const game *m_parent;

    };
    inline void new_story(const part&amp; data) {m_story.push_back(data);}
    void set_story(size_t index);
    void run();
    inline short get_save() const {return m_save;}
    inline size_t get_vector() const {return m_story.size();}
    friend std::ostream&amp; operator&lt;&lt; (std::ostream&amp; out, const game::part&amp; data);

    private:
    std::vector&lt;part&gt; m_story;
    const std::string m_message;
    short m_save;

};

#endif // GAME_HPP_INCLUDED
</code></pre>
<p>game.cpp</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;game.hpp&quot;

game::game()
:m_message(&quot;Du bist doch Deutschlands d\x81mmster! Ist es so schwierig eine Zahl zwischen\n1 und 3 einzugeben?&quot;
         + std::string(&quot; Probiers nochmal du Arschloch!\n&quot;)),m_save(1)
{

}

game::~game()
{

}

game::part::part(const game *parent_,
                 const std::string&amp; question1_, const std::string&amp; question2_, const std::string&amp; question3_,
                 const std::string&amp; a_,const std::string&amp; b_,const std::string&amp; c_,
                 const std::string&amp; effect1_,const std::string&amp; effect2_=&quot;&quot;,const std::string&amp; effect3_=&quot;&quot;)
:m_parent(parent_),m_a(a_),m_b(b_),m_c(c_)
{
    m_question[0]=question1_;
    m_question[1]=question2_;
    m_question[2]=question3_;
    m_effect[0]=effect1_;
    m_effect[1]=effect2_;
    m_effect[2]=effect3_;

}

void game::set_story(size_t index)
{
    std::cout &lt;&lt; m_story[index];
    while(!(std::cin &gt;&gt; m_save) || (m_save&gt;3) || (m_save&lt;1))
    {
        std::cin.clear(); std::cin.ignore(std::numeric_limits&lt;std::streamsize&gt;::max(), '\n');
        std::cout &lt;&lt; m_message;
    }
    if (m_story[index].m_effect[1].empty() == true &amp;&amp; m_story[index].m_effect[2].empty() == true)
    {
        std::cout &lt;&lt; m_story[index].m_effect[0];
        return;
    }
    std::cout &lt;&lt; m_story[index].m_effect[m_save-1];
}
</code></pre>
<p>operators.hpp</p>
<pre><code class="language-cpp">#ifndef OPERATORS_HPP_INCLUDED
#define OPERATORS_HPP_INCLUDED

#include &lt;iostream&gt;
#include &quot;game.hpp&quot;

std::ostream&amp; operator&lt;&lt; (std::ostream&amp; out, const game::part&amp; data);

#endif // OPERATORS_HPP_INCLUDED
</code></pre>
<p>operators.cpp</p>
<pre><code class="language-cpp">#include &quot;operators.hpp&quot;

std::ostream&amp; operator&lt;&lt; (std::ostream&amp; out, const game::part&amp; data)
{
    out &lt;&lt; data.m_question[data.get_parent()-&gt;get_save()-1] &lt;&lt; data.m_a &lt;&lt; data.m_b &lt;&lt; data.m_c;
    return out;
}
</code></pre>
<p>story.cpp</p>
<pre><code class="language-cpp">#include &quot;game.hpp&quot;

void game::run()
{
    new_story(game::part(this,
                         &quot;Wer wollen sie sein?\n&quot;,&quot;&quot;,&quot;&quot;,
                         &quot;1. Hitler\n&quot;,&quot;2. Ghandi\n&quot;,&quot;3. Georg W. Bush\n&quot;,
                         &quot;Sie sind nun Hitler!\n&quot;, &quot;Sie sind nun Ghandi!\n&quot;, &quot;Sie sind nun Georg W. Bush!\n&quot;));
   ......
   ....... //restlichen Text erspar ich euch^^
   ........
}
</code></pre>
<p>ic.hpp</p>
<pre><code class="language-cpp">IMPROVED CONSOLE
</code></pre>
<p><a href="http://web56.hermes.server-pool.de/pages/ic.c-plusplus.net/" rel="nofollow">http://web56.hermes.server-pool.de/pages/ic.c-plusplus.net/</a></p>
<p>ic.cpp</p>
<pre><code class="language-cpp">IMPROVED CONSOLE
</code></pre>
<p><a href="http://web56.hermes.server-pool.de/pages/ic.c-plusplus.net/" rel="nofollow">http://web56.hermes.server-pool.de/pages/ic.c-plusplus.net/</a></p>
<p>WARNINGS:</p>
<blockquote>
<p>-------------- Build: Debug in GAME ---------------<br />
Compiling: ic.cpp<br />
Compiling: main.cpp<br />
Compiling: operators.cpp<br />
Compiling: story.cpp<br />
Compiling: game.cpp<br />
game.hpp: In constructor <code>game::part::part(const game*, const std::string&amp;, const std::string&amp;, const std::string&amp;, const std::string&amp;, const std::string&amp;, const std::string&amp;, const std::string&amp;, const std::string&amp;, const std::string&amp;)': game.hpp:23: warning:</code>game::part::m_parent' will be initialized after<br />
game.hpp:17: warning: `std::string game::part::m_a'<br />
game.cpp:22: warning: when initialized here<br />
Linking console executable: .\GAME.exe<br />
Process terminated with status 0 (0 minutes, 2 seconds)<br />
0 errors, 3 warnings</p>
</blockquote>
<p>2. PROBLEM:<br />
Seit dem ich Vollbildmodus habe, also &quot;con.enableWndFSMode();&quot; (die Funktion aus der improved console) wird ein Text wenn er über das Zeilenende geht nicht mehr eine Zeile weiter unten drunter geschrieben, sondern es wird einfach am Zeilenanfang wieder weitergeschriebn, und somit die Zeile teils überschrieben...<br />
Wie kann ich das verhindern? Warum passiert das überhaupt?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/192159/quot-warnings-quot-im-code-kein-zeilenumbruch-bei-vollbild</link><generator>RSS for Node</generator><lastBuildDate>Sun, 27 Sep 2026 09:20:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/192159.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 11 Sep 2007 09:30:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to &amp;quot;warnings&amp;quot; im Code : Kein Zeilenumbruch bei Vollbild on Tue, 11 Sep 2007 09:30:40 GMT]]></title><description><![CDATA[<p>Vll. kann sich jemand ja noch an meinen Weltraumvernichtungssimulator erinnern, um denn geht es jetzt nämlich. Und zwar gibts n paar warnings, aber ich weiß nicht genau warum.</p>
<p>main.cpp</p>
<pre><code class="language-cpp">#include &quot;game.hpp&quot;
#include &quot;operators.hpp&quot;
#include &quot;events.hpp&quot;
#include &quot;ic.hpp&quot;

using namespace std;
using namespace ic;
using namespace shorties;

int main()
{
    con.enableWndFSMode();
    game wus;
    wus.run();
    int counter=0;
    while(1)
    {
            if (counter&lt;wus.get_vector())
            { 
                wus.set_story(counter);
                ++counter;
            }
    }

    return 0;
}
</code></pre>
<p>game.hpp</p>
<pre><code class="language-cpp">#ifndef INCLUDE_GAME_HPP
#define INCLUDE_GAME_HPP

#include &lt;vector&gt;
#include &lt;string&gt;
#include &lt;limits&gt;

class game
{
    public:

    game();
    ~game();
    struct part
    {
        const game * get_parent() const {return m_parent;}
        std::string m_question[3], m_a, m_b, m_c, m_effect[3];
        part(const game *parent_,
             const std::string&amp; question1_,const std::string&amp; question2_,const std::string&amp; question3_,
             const std::string&amp; a_,const std::string&amp; b_,const std::string&amp; c_,
             const std::string&amp; effect1_,const std::string&amp; effect2_,const std::string&amp; effect3_);
        private:
        const game *m_parent;

    };
    inline void new_story(const part&amp; data) {m_story.push_back(data);}
    void set_story(size_t index);
    void run();
    inline short get_save() const {return m_save;}
    inline size_t get_vector() const {return m_story.size();}
    friend std::ostream&amp; operator&lt;&lt; (std::ostream&amp; out, const game::part&amp; data);

    private:
    std::vector&lt;part&gt; m_story;
    const std::string m_message;
    short m_save;

};

#endif // GAME_HPP_INCLUDED
</code></pre>
<p>game.cpp</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;game.hpp&quot;

game::game()
:m_message(&quot;Du bist doch Deutschlands d\x81mmster! Ist es so schwierig eine Zahl zwischen\n1 und 3 einzugeben?&quot;
         + std::string(&quot; Probiers nochmal du Arschloch!\n&quot;)),m_save(1)
{

}

game::~game()
{

}

game::part::part(const game *parent_,
                 const std::string&amp; question1_, const std::string&amp; question2_, const std::string&amp; question3_,
                 const std::string&amp; a_,const std::string&amp; b_,const std::string&amp; c_,
                 const std::string&amp; effect1_,const std::string&amp; effect2_=&quot;&quot;,const std::string&amp; effect3_=&quot;&quot;)
:m_parent(parent_),m_a(a_),m_b(b_),m_c(c_)
{
    m_question[0]=question1_;
    m_question[1]=question2_;
    m_question[2]=question3_;
    m_effect[0]=effect1_;
    m_effect[1]=effect2_;
    m_effect[2]=effect3_;

}

void game::set_story(size_t index)
{
    std::cout &lt;&lt; m_story[index];
    while(!(std::cin &gt;&gt; m_save) || (m_save&gt;3) || (m_save&lt;1))
    {
        std::cin.clear(); std::cin.ignore(std::numeric_limits&lt;std::streamsize&gt;::max(), '\n');
        std::cout &lt;&lt; m_message;
    }
    if (m_story[index].m_effect[1].empty() == true &amp;&amp; m_story[index].m_effect[2].empty() == true)
    {
        std::cout &lt;&lt; m_story[index].m_effect[0];
        return;
    }
    std::cout &lt;&lt; m_story[index].m_effect[m_save-1];
}
</code></pre>
<p>operators.hpp</p>
<pre><code class="language-cpp">#ifndef OPERATORS_HPP_INCLUDED
#define OPERATORS_HPP_INCLUDED

#include &lt;iostream&gt;
#include &quot;game.hpp&quot;

std::ostream&amp; operator&lt;&lt; (std::ostream&amp; out, const game::part&amp; data);

#endif // OPERATORS_HPP_INCLUDED
</code></pre>
<p>operators.cpp</p>
<pre><code class="language-cpp">#include &quot;operators.hpp&quot;

std::ostream&amp; operator&lt;&lt; (std::ostream&amp; out, const game::part&amp; data)
{
    out &lt;&lt; data.m_question[data.get_parent()-&gt;get_save()-1] &lt;&lt; data.m_a &lt;&lt; data.m_b &lt;&lt; data.m_c;
    return out;
}
</code></pre>
<p>story.cpp</p>
<pre><code class="language-cpp">#include &quot;game.hpp&quot;

void game::run()
{
    new_story(game::part(this,
                         &quot;Wer wollen sie sein?\n&quot;,&quot;&quot;,&quot;&quot;,
                         &quot;1. Hitler\n&quot;,&quot;2. Ghandi\n&quot;,&quot;3. Georg W. Bush\n&quot;,
                         &quot;Sie sind nun Hitler!\n&quot;, &quot;Sie sind nun Ghandi!\n&quot;, &quot;Sie sind nun Georg W. Bush!\n&quot;));
   ......
   ....... //restlichen Text erspar ich euch^^
   ........
}
</code></pre>
<p>ic.hpp</p>
<pre><code class="language-cpp">IMPROVED CONSOLE
</code></pre>
<p><a href="http://web56.hermes.server-pool.de/pages/ic.c-plusplus.net/" rel="nofollow">http://web56.hermes.server-pool.de/pages/ic.c-plusplus.net/</a></p>
<p>ic.cpp</p>
<pre><code class="language-cpp">IMPROVED CONSOLE
</code></pre>
<p><a href="http://web56.hermes.server-pool.de/pages/ic.c-plusplus.net/" rel="nofollow">http://web56.hermes.server-pool.de/pages/ic.c-plusplus.net/</a></p>
<p>WARNINGS:</p>
<blockquote>
<p>-------------- Build: Debug in GAME ---------------<br />
Compiling: ic.cpp<br />
Compiling: main.cpp<br />
Compiling: operators.cpp<br />
Compiling: story.cpp<br />
Compiling: game.cpp<br />
game.hpp: In constructor <code>game::part::part(const game*, const std::string&amp;, const std::string&amp;, const std::string&amp;, const std::string&amp;, const std::string&amp;, const std::string&amp;, const std::string&amp;, const std::string&amp;, const std::string&amp;)': game.hpp:23: warning:</code>game::part::m_parent' will be initialized after<br />
game.hpp:17: warning: `std::string game::part::m_a'<br />
game.cpp:22: warning: when initialized here<br />
Linking console executable: .\GAME.exe<br />
Process terminated with status 0 (0 minutes, 2 seconds)<br />
0 errors, 3 warnings</p>
</blockquote>
<p>2. PROBLEM:<br />
Seit dem ich Vollbildmodus habe, also &quot;con.enableWndFSMode();&quot; (die Funktion aus der improved console) wird ein Text wenn er über das Zeilenende geht nicht mehr eine Zeile weiter unten drunter geschrieben, sondern es wird einfach am Zeilenanfang wieder weitergeschriebn, und somit die Zeile teils überschrieben...<br />
Wie kann ich das verhindern? Warum passiert das überhaupt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1363109</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1363109</guid><dc:creator><![CDATA[Stromberg]]></dc:creator><pubDate>Tue, 11 Sep 2007 09:30:40 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;warnings&amp;quot; im Code : Kein Zeilenumbruch bei Vollbild on Tue, 11 Sep 2007 09:56:28 GMT]]></title><description><![CDATA[<p>Die Warnings kommen aus der Initialisierungsliste deines C'tors.</p>
<p>Die Elemente werden in der Reihenfolge erzeugt, in der sie deklariert(?) wurden und der g++ warnt, wenn sie in einer anderen Reihenfolge in der Initialisierungsliste auftauchen.</p>
<p>Fehler entstehen z.B. bei folgendem Code:</p>
<pre><code class="language-cpp">class foo
{
   int bar;
   int foobar;

   foo() : 
      foobar(2),
      bar(foobar)//foobar noch nicht erzeugt
      {}
};
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1363129</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1363129</guid><dc:creator><![CDATA[darthdespotism]]></dc:creator><pubDate>Tue, 11 Sep 2007 09:56:28 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;warnings&amp;quot; im Code : Kein Zeilenumbruch bei Vollbild on Tue, 11 Sep 2007 10:01:18 GMT]]></title><description><![CDATA[<p>Zu den warnings: ich hab mir jetzt nicht deinen ganzen Code durchsucht um die entsprechende Stelle zu finden, aber es sieht so aus, als haettest du die Initialisiererliste im Konstruktor andersrum geschrieben als die Deklaration der entsprechenden Variablen. Da aber in C++ immer in der reihenfolge initialisiert wird, wie die Variablen in der Deklaration stehen, wird die Initialisierungsliste in dem Fall nicht von vorn nach hinten abgearbeitet sondern etwas hin und hergesprungen. Am besten schreibt man daher die initliste genau in der Reihenfolge wie die Deklaration, damit nichts unerwartetes passiert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1363134</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1363134</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Tue, 11 Sep 2007 10:01:18 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;warnings&amp;quot; im Code : Kein Zeilenumbruch bei Vollbild on Tue, 11 Sep 2007 19:31:17 GMT]]></title><description><![CDATA[<p>Mh, also ich verstehes nicht so ganz, weil nur &quot;struct&quot; hat eine Initialisierungsliste, und in dieser steht doch alles in der richtigen Reihenfolge. Welche Stelle meint ihr den jetzt genau, sry ich stehe grad auf der Leitung. Und äh kann sich vll. noch jemand mein 2. Problem anschaun?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1363616</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1363616</guid><dc:creator><![CDATA[Stromberg]]></dc:creator><pubDate>Tue, 11 Sep 2007 19:31:17 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;warnings&amp;quot; im Code : Kein Zeilenumbruch bei Vollbild on Tue, 11 Sep 2007 19:46:24 GMT]]></title><description><![CDATA[<p>Dann schau noch mal ganz genau hin:</p>
<pre><code class="language-cpp">struct part 
{ 
    //...
    std::string m_question[3], m_a, m_b, m_c, m_effect[3]; 
    //...
    const game *m_parent; 
};

//...

game::part::part(/*...*/)
: m_parent(parent_),m_a(a_),m_b(b_),m_c(c_)
</code></pre>
<p>*hust* Oh, naja hast wohl Recht. Scheint alles in Ordnung zu sein. *hust*</p>
<p>Gruß<br />
Don06</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1363623</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1363623</guid><dc:creator><![CDATA[Don06]]></dc:creator><pubDate>Tue, 11 Sep 2007 19:46:24 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;warnings&amp;quot; im Code : Kein Zeilenumbruch bei Vollbild on Tue, 11 Sep 2007 19:49:31 GMT]]></title><description><![CDATA[<p>Oh, mh &quot;game *m_parent&quot; kommt erst zum schluss nä? ...Und was ist jetzt mit meinem 2. Problem...dem nicht Zeilenumbruch bei eingeschaltetem Vollbildmodus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1363625</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1363625</guid><dc:creator><![CDATA[Stromberg]]></dc:creator><pubDate>Tue, 11 Sep 2007 19:49:31 GMT</pubDate></item></channel></rss>