<?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[vector size() : Merkwürdie Fehler]]></title><description><![CDATA[<p>Kann mir jemand sagen warum das nicht geht. Seit dem ich in meinen Code eine Zeile mit vector.size() eingefügt habe geht er nicht mehr, und es kommen merkwürdige Fehlermeldungen.</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();) //HIER! Da passt im irgendwas mit &quot;std::&quot;? Wo muss da noch eins hin? Ohne diese Zeile funktioniert der Code anstandslos.

    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>
]]></description><link>https://www.c-plusplus.net/forum/topic/192073/vector-size-merkwürdie-fehler</link><generator>RSS for Node</generator><lastBuildDate>Sun, 27 Sep 2026 07:59:17 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/192073.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 10 Sep 2007 09:50:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to vector size() : Merkwürdie Fehler on Mon, 10 Sep 2007 09:50:14 GMT]]></title><description><![CDATA[<p>Kann mir jemand sagen warum das nicht geht. Seit dem ich in meinen Code eine Zeile mit vector.size() eingefügt habe geht er nicht mehr, und es kommen merkwürdige Fehlermeldungen.</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();) //HIER! Da passt im irgendwas mit &quot;std::&quot;? Wo muss da noch eins hin? Ohne diese Zeile funktioniert der Code anstandslos.

    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>
]]></description><link>https://www.c-plusplus.net/forum/post/1362421</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1362421</guid><dc:creator><![CDATA[Stromberg]]></dc:creator><pubDate>Mon, 10 Sep 2007 09:50:14 GMT</pubDate></item><item><title><![CDATA[Reply to vector size() : Merkwürdie Fehler on Mon, 10 Sep 2007 09:56:11 GMT]]></title><description><![CDATA[<p>Was ist bitte &quot;da passt ihm irgendwas nicht&quot; für eine Fehlerbeschreibung?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1362428</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1362428</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Mon, 10 Sep 2007 09:56:11 GMT</pubDate></item><item><title><![CDATA[Reply to vector size() : Merkwürdie Fehler on Mon, 10 Sep 2007 09:58:23 GMT]]></title><description><![CDATA[<p>Aso, ja hier, is aber bissel lang:</p>
<blockquote>
<p>-------------- Build: Debug in GAME ---------------<br />
Compiling: main.cpp<br />
In file included from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/localefwd.h:48,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ios:48,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ostream:45,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/iostream:45,<br />
from operators.hpp:4,<br />
from main.cpp:2:<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/functexcept.h:36: error: expected unqualified-id before &quot;namespace&quot;<br />
In file included from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ios:48,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ostream:45,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/iostream:45,<br />
from operators.hpp:4,<br />
from main.cpp:2:<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/localefwd.h:50: error: expected unqualified-id before &quot;namespace&quot;<br />
In file included from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/ios_base.h:47,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ios:49,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ostream:45,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/iostream:45,<br />
from operators.hpp:4,<br />
from main.cpp:2:<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/locale_classes.h:51: error: expected unqualified-id before &quot;namespace&quot;<br />
In file included from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ios:49,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ostream:45,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/iostream:45,<br />
from operators.hpp:4,<br />
from main.cpp:2:<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/ios_base.h:49: error: expected unqualified-id before &quot;namespace&quot;<br />
In file included from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ios:50,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ostream:45,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/iostream:45,<br />
from operators.hpp:4,<br />
from main.cpp:2:<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/streambuf:50: error: expected unqualified-id before &quot;namespace&quot;<br />
In file included from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/streambuf:781,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ios:50,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ostream:45,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/iostream:45,<br />
from operators.hpp:4,<br />
from main.cpp:2:<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/streambuf.tcc:40: error: expected unqualified-id before &quot;namespace&quot;<br />
In file included from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/basic_ios.h:41,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ios:51,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ostream:45,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/iostream:45,<br />
from operators.hpp:4,<br />
from main.cpp:2:<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/streambuf_iterator.h:46: error: expected unqualified-id before &quot;namespace&quot;<br />
In file included from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/locale_facets.h:46,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/basic_ios.h:44,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ios:51,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ostream:45,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/iostream:45,<br />
from operators.hpp:4,<br />
from main.cpp:2:<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/cwctype:79: error: expected unqualified-id before &quot;namespace&quot;<br />
In file included from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/basic_ios.h:44,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ios:51,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ostream:45,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/iostream:45,<br />
from operators.hpp:4,<br />
from main.cpp:2:<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/locale_facets.h:51: error: expected unqualified-id before &quot;namespace&quot;<br />
In file included from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ios:51,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ostream:45,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/iostream:45,<br />
from operators.hpp:4,<br />
from main.cpp:2:<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/basic_ios.h:46: error: expected unqualified-id before &quot;namespace&quot;<br />
In file included from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/basic_ios.h:464,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ios:51,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ostream:45,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/iostream:45,<br />
from operators.hpp:4,<br />
from main.cpp:2:<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/basic_ios.tcc:35: error: expected unqualified-id before &quot;namespace&quot;<br />
In file included from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/iostream:45,<br />
from operators.hpp:4,<br />
from main.cpp:2:<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ostream:47: error: expected unqualified-id before &quot;namespace&quot;<br />
In file included from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/locale_facets.tcc:39,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/locale:47,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/ostream.tcc:40,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ostream:545,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/iostream:45,<br />
from operators.hpp:4,<br />
from main.cpp:2:<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/typeinfo:40: error: expected unqualified-id before string constant<br />
In file included from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/locale:47,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/ostream.tcc:40,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ostream:545,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/iostream:45,<br />
from operators.hpp:4,<br />
from main.cpp:2:<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/locale_facets.tcc:42: error: expected unqualified-id before &quot;namespace&quot;<br />
In file included from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/ostream:545,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/iostream:45,<br />
from operators.hpp:4,<br />
from main.cpp:2:<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/ostream.tcc:42: error: expected unqualified-id before &quot;namespace&quot;<br />
In file included from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/iostream:46,<br />
from operators.hpp:4,<br />
from main.cpp:2:<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/istream:48: error: expected unqualified-id before &quot;namespace&quot;<br />
In file included from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/istream:771,<br />
from c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/iostream:46,<br />
from operators.hpp:4,<br />
from main.cpp:2:<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/istream.tcc:43: error: expected unqualified-id before &quot;namespace&quot;<br />
In file included from operators.hpp:4,<br />
from main.cpp:2:<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/iostream:48: error: expected unqualified-id before &quot;namespace&quot;<br />
In file included from main.cpp:2:<br />
operators.hpp:7: error: <code>std::ostream&amp; game::operator&lt;&lt;(std::ostream&amp;, const game::part&amp;)' must take exactly one argument main.cpp:3: error: expected nested-name-specifier before &quot;namespace&quot; main.cpp:3: error: expected unqualified-id before &quot;namespace&quot; main.cpp:3: error: expected</code>;' before &quot;namespace&quot;<br />
main.cpp:3: error: expected unqualified-id before &quot;namespace&quot;<br />
main.cpp:18: error: expected <code>}' at end of input game.hpp: In member function</code>void game::new_story(const game::part&amp;)':<br />
game.hpp:26: error: <code>m_story' undeclared (first use this function) game.hpp:26: error: (Each undeclared identifier is reported only once for each function it appears in.) game.hpp: In member function</code>short int game::get_save() const':<br />
game.hpp:29: error: <code>m_save' undeclared (first use this function) game.hpp: In member function</code>size_t game::get_vector() const':<br />
game.hpp:30: error: <code>m_story' undeclared (first use this function) game.hpp:30: error: expected primary-expression before ')' token game.hpp:30: error: expected</code>;' before ')' token<br />
game.hpp:34: error: expected primary-expression before &quot;private&quot;<br />
game.hpp:34: error: expected <code>;' before &quot;private&quot; game.hpp:37: warning: unused variable 'm_save' main.cpp: At global scope: main.cpp:18: error: expected unqualified-id at end of input main.cpp:18: error: expected</code>,' or `;' at end of input<br />
Process terminated with status 1 (0 minutes, 0 seconds)<br />
34 errors, 1 warnings</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1362431</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1362431</guid><dc:creator><![CDATA[Stromberg]]></dc:creator><pubDate>Mon, 10 Sep 2007 09:58:23 GMT</pubDate></item><item><title><![CDATA[Reply to vector size() : Merkwürdie Fehler on Mon, 10 Sep 2007 09:58:24 GMT]]></title><description><![CDATA[<pre><code>inline size_t get_vector() const {return m_story.size();[b])[/b]
</code></pre>
<p>Statt einer runden eine geschweifte Klammer würde ich vermuten...</p>
<p>Gruß<br />
zeigerzeiger</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1362432</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1362432</guid><dc:creator><![CDATA[zeigerzeiger]]></dc:creator><pubDate>Mon, 10 Sep 2007 09:58:24 GMT</pubDate></item><item><title><![CDATA[Reply to vector size() : Merkwürdie Fehler on Mon, 10 Sep 2007 10:00:27 GMT]]></title><description><![CDATA[<p>OHHHH!! Wie peinlich...:( ich sollt mir echt mal eine Brille zu legen, das ich so dumm bin und des übersehe...:(</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1362435</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1362435</guid><dc:creator><![CDATA[Stromberg]]></dc:creator><pubDate>Mon, 10 Sep 2007 10:00:27 GMT</pubDate></item><item><title><![CDATA[Reply to vector size() : Merkwürdie Fehler on Mon, 10 Sep 2007 10:10:08 GMT]]></title><description><![CDATA[<p>Stromberg schrieb:</p>
<blockquote>
<p>OHHHH!! Wie peinlich...:( ich sollt mir echt mal eine Brille zu legen, das ich so dumm bin und des übersehe...:(</p>
</blockquote>
<p>Auch ein Stromberg kann mal was übersehen! (oder gerade der? <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1362442</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1362442</guid><dc:creator><![CDATA[plizer]]></dc:creator><pubDate>Mon, 10 Sep 2007 10:10:08 GMT</pubDate></item></channel></rss>