<?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[wieso geht das nicht??]]></title><description><![CDATA[<p>hallo folgendes prob:</p>
<pre><code>//--- Part. Including ----------------------------------------------------------

 #include &lt;iostream&gt;
    using namespace std;
 #include &lt;vector&gt;
 #include &lt;string&gt;
//==============================================================================

    class Person
    {
    public:
        Person();
        ~Person();
        void SetAngaben(string pname,string pnickname,string padress,int ptelnr,int page);
        void ShowAll();

    private:
        string name, nickname, adress;
        int telnr, age;
    };

    void Person::SetAngaben(string pname,string pnickname,string padress int ptelnr,int page)
    {

        this-&gt;name = pname;
        this-&gt;nickname = pnickname;
        this-&gt;adress = padress;
        this-&gt;telnr = telnr;
        this-&gt;age = page;
    }

    void ShowAll()
    {
        cout &lt;&lt; &quot;Ihre Angaben waren wie folgt:\n\n&quot;
             &lt;&lt; &quot;Name    : &quot; &lt;&lt; name &lt;&lt; &quot;\n&quot;
             &lt;&lt; &quot;Nickname: &quot; &lt;&lt; nickname &lt;&lt; &quot;\n&quot;
             &lt;&lt; &quot;Alter   : &quot; &lt;&lt; age &lt;&lt; &quot;\n&quot;
             &lt;&lt; &quot;Adresse : &quot; &lt;&lt; adress &lt;&lt; &quot;\n&quot;
             &lt;&lt; &quot;Telefon : &quot; &lt;&lt; telenr &lt;&lt; &quot;\n\n&quot;;
    }

    Person::Person() {}
    Person::~Pernon() {}

main()
{
    string in_name, in_nickname, in_adress;
    int in_telnr, in_age;

    cout &lt;&lt; &quot; Bitte geben Sie hier die folgenden Daten an! Danke :)\n\n&quot;;
    cout &lt;&lt; &quot; Ihren vollstaendigen Namen.        : &quot;; cin &gt;&gt; in_name;
    cout &lt;&lt; &quot; Wie lautet ihr Spitzname?          : &quot;; cin &gt;&gt; in_nickname;
    cout &lt;&lt; &quot; Wie alt sind Sie?                  : &quot;; cin &gt;&gt; in_age;
    cout &lt;&lt; &quot; Geben Sie bitte ihre Anschrift an! : &quot;; cin &gt;&gt; in_adress;
    cout &lt;&lt; &quot; Wie lautet ihre Telefonnummer?     : &quot;; cin &gt;&gt; in_telnr;
    cout &lt;&lt; &quot;\n\n&quot;;

    SetAngaben(in_name,in_nickname,in_adress,in_telnr,in_age);
    ShowAll();
    cin.get();
}
</code></pre>
<p>in der zeile:</p>
<pre><code>void Person::SetAngaben(string pname,string pnickname,string padress int ptelnr,int page)
</code></pre>
<p>meckert der compiler: &quot; [C++ Error] Unit1.cpp(22): E2451 Undefined symbol 'string' &quot; ... was kann ich tun ????</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/151967/wieso-geht-das-nicht</link><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Sep 2026 19:47:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/151967.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 01 Jul 2006 11:03:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to wieso geht das nicht?? on Sat, 01 Jul 2006 11:14:48 GMT]]></title><description><![CDATA[<p>hallo folgendes prob:</p>
<pre><code>//--- Part. Including ----------------------------------------------------------

 #include &lt;iostream&gt;
    using namespace std;
 #include &lt;vector&gt;
 #include &lt;string&gt;
//==============================================================================

    class Person
    {
    public:
        Person();
        ~Person();
        void SetAngaben(string pname,string pnickname,string padress,int ptelnr,int page);
        void ShowAll();

    private:
        string name, nickname, adress;
        int telnr, age;
    };

    void Person::SetAngaben(string pname,string pnickname,string padress int ptelnr,int page)
    {

        this-&gt;name = pname;
        this-&gt;nickname = pnickname;
        this-&gt;adress = padress;
        this-&gt;telnr = telnr;
        this-&gt;age = page;
    }

    void ShowAll()
    {
        cout &lt;&lt; &quot;Ihre Angaben waren wie folgt:\n\n&quot;
             &lt;&lt; &quot;Name    : &quot; &lt;&lt; name &lt;&lt; &quot;\n&quot;
             &lt;&lt; &quot;Nickname: &quot; &lt;&lt; nickname &lt;&lt; &quot;\n&quot;
             &lt;&lt; &quot;Alter   : &quot; &lt;&lt; age &lt;&lt; &quot;\n&quot;
             &lt;&lt; &quot;Adresse : &quot; &lt;&lt; adress &lt;&lt; &quot;\n&quot;
             &lt;&lt; &quot;Telefon : &quot; &lt;&lt; telenr &lt;&lt; &quot;\n\n&quot;;
    }

    Person::Person() {}
    Person::~Pernon() {}

main()
{
    string in_name, in_nickname, in_adress;
    int in_telnr, in_age;

    cout &lt;&lt; &quot; Bitte geben Sie hier die folgenden Daten an! Danke :)\n\n&quot;;
    cout &lt;&lt; &quot; Ihren vollstaendigen Namen.        : &quot;; cin &gt;&gt; in_name;
    cout &lt;&lt; &quot; Wie lautet ihr Spitzname?          : &quot;; cin &gt;&gt; in_nickname;
    cout &lt;&lt; &quot; Wie alt sind Sie?                  : &quot;; cin &gt;&gt; in_age;
    cout &lt;&lt; &quot; Geben Sie bitte ihre Anschrift an! : &quot;; cin &gt;&gt; in_adress;
    cout &lt;&lt; &quot; Wie lautet ihre Telefonnummer?     : &quot;; cin &gt;&gt; in_telnr;
    cout &lt;&lt; &quot;\n\n&quot;;

    SetAngaben(in_name,in_nickname,in_adress,in_telnr,in_age);
    ShowAll();
    cin.get();
}
</code></pre>
<p>in der zeile:</p>
<pre><code>void Person::SetAngaben(string pname,string pnickname,string padress int ptelnr,int page)
</code></pre>
<p>meckert der compiler: &quot; [C++ Error] Unit1.cpp(22): E2451 Undefined symbol 'string' &quot; ... was kann ich tun ????</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1089457</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1089457</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sat, 01 Jul 2006 11:14:48 GMT</pubDate></item><item><title><![CDATA[Reply to wieso geht das nicht?? on Sat, 01 Jul 2006 11:22:03 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;iostream&gt;
    using namespace std;
 #include &lt;vector&gt;
 #include &lt;string&gt;
</code></pre>
<p>deswegen geht das net<br />
Wenn du schon &quot;using namespace std;&quot; verwendest muss das nach den ganzen includes sein.</p>
<p>BR</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1089465</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1089465</guid><dc:creator><![CDATA[evilissimo]]></dc:creator><pubDate>Sat, 01 Jul 2006 11:22:03 GMT</pubDate></item><item><title><![CDATA[Reply to wieso geht das nicht?? on Sat, 01 Jul 2006 11:33:38 GMT]]></title><description><![CDATA[<p>evilissimo schrieb:</p>
<blockquote>
<pre><code class="language-cpp">#include &lt;iostream&gt;
    using namespace std;
 #include &lt;vector&gt;
 #include &lt;string&gt;
</code></pre>
<p>deswegen geht das net<br />
Wenn du schon &quot;using namespace std;&quot; verwendest muss das nach den ganzen includes sein.</p>
<p>BR</p>
</blockquote>
<p>das sollte keine rolle spielen. die fehlernummer sagt mir auch nichts. ist das der borland compiler? der hat ja bekanntermaßen gewisse <a href="http://boost.org/more/borland_cpp.html" rel="nofollow">schwierigkeiten mit using</a>. insofern hilft der rat ja evtl. standard C++ verlangt so etwas jedenfalls nicht. unter anderem auch in Herb Sutters More Exceptional C++, Item 39</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1089470</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1089470</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Sat, 01 Jul 2006 11:33:38 GMT</pubDate></item><item><title><![CDATA[Reply to wieso geht das nicht?? on Sat, 01 Jul 2006 12:00:03 GMT]]></title><description><![CDATA[<p>jo ich prog mit C++ Borland Builder 6 Enterprise, danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1089488</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1089488</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sat, 01 Jul 2006 12:00:03 GMT</pubDate></item><item><title><![CDATA[Reply to wieso geht das nicht?? on Sat, 01 Jul 2006 12:08:50 GMT]]></title><description><![CDATA[<p>hmm... is ja uebel.... auch wenn ich using namespace std; ans ende von include setze aendert das auch nichts.... und ich habs mal mit &quot;CodeBlocks&quot; zu compilieren versucht doch da bekomm ich nur noch mehr fehler angesagt(12stück). was geht da...-.-</p>
<p>ps: :schland: Super gaMe weiter so!! <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/1089499</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1089499</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sat, 01 Jul 2006 12:08:50 GMT</pubDate></item><item><title><![CDATA[Reply to wieso geht das nicht?? on Sat, 01 Jul 2006 12:24:22 GMT]]></title><description><![CDATA[<p>T0bi schrieb:</p>
<blockquote>
<p>hmm... is ja uebel.... auch wenn ich using namespace std; ans ende von include setze aendert das auch nichts.... und ich habs mal mit &quot;CodeBlocks&quot; zu compilieren versucht doch da bekomm ich nur noch mehr fehler angesagt(12stück). was geht da...-.-</p>
</blockquote>
<p>es sind ja auch mindestens 2 fehler drin:</p>
<pre><code>void Person::SetAngaben(string pname,string pnickname,string padress[b],/*komma vergessen*/[/b] int ptelnr,int page)
</code></pre>
<pre><code>[b]int[/b] main()
</code></pre>
<p>dazu noch diverse tippfehler bei variablennamen. übrigens ist es ad<strong>d</strong>ress im englischen <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/1089505</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1089505</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Sat, 01 Jul 2006 12:24:22 GMT</pubDate></item><item><title><![CDATA[Reply to wieso geht das nicht?? on Sun, 02 Jul 2006 12:13:27 GMT]]></title><description><![CDATA[<p>halloo.... wie mach ich des nun mit aus dem container von nen vector daten speichern (hoffe war richtig von moA formuliert)...</p>
<p>also sieht nun alles so aus:</p>
<pre><code>//--- Part. Including ----------------------------------------------------------

 #include &lt;iostream&gt;
 #include &lt;vector&gt;
 #include &lt;string&gt;
 #include &lt;fstream&gt;
     using namespace std;
//==============================================================================

    class person
    {
    public:
        void SetAngaben(string pname,string pnickname,string paddress,string ptelnr,string page);
        void ShowAll();
        person();
        ~person();
    private:
        string name, nickname, address, telnr, age;
    };

    void person::SetAngaben(string pname,string pnickname,string padress, string ptelnr,string page)
    {

        this-&gt;name = pname;
        this-&gt;nickname = pnickname;
        this-&gt;address = padress;
        this-&gt;telnr = ptelnr;
        this-&gt;age = page;
    }

    void person::ShowAll()
    {
        cout &lt;&lt; &quot;Ihre Angaben waren wie folgt:\n\n&quot;
             &lt;&lt; &quot;Name    : &quot; &lt;&lt; name &lt;&lt; &quot;\n&quot;
             &lt;&lt; &quot;Nickname: &quot; &lt;&lt; nickname &lt;&lt; &quot;\n&quot;
             &lt;&lt; &quot;Alter   : &quot; &lt;&lt; age &lt;&lt; &quot;\n&quot;
             &lt;&lt; &quot;Adresse : &quot; &lt;&lt; address &lt;&lt; &quot;\n&quot;
             &lt;&lt; &quot;Telefon : &quot; &lt;&lt; telnr &lt;&lt; &quot;\n\n&quot;;
             cin.get();
    }

    person::person()
    {
    }

    person::~person()
    {
    }

//--- Part. Save &amp; Load Funktion -----------------------------------------------

 void Save()
 {
    vector &lt;person&gt; angaben;

        angaben.push_back();

        ofstream file(&quot;C:\\testen&quot;,ios::out|ios::app);

            file &lt;&lt; &quot;\n&quot; &lt;&lt; angaben.pop_back();
            close.file();
 }

main()
{
    string in_name, in_nickname, in_address, in_telnr, in_age;

    cout &lt;&lt; &quot; Bitte geben Sie hier die folgenden Daten an! Danke :)\n\n&quot;;
    cout &lt;&lt; &quot; Ihren vollstaendigen Namen         : &quot;; getline(cin, in_name);
    cout &lt;&lt; &quot; Wie lautet ihr Spitzname?          : &quot;; getline(cin, in_nickname);
    cout &lt;&lt; &quot; Wie alt sind Sie?                  : &quot;; getline(cin, in_age);
    cout &lt;&lt; &quot; Geben Sie bitte ihre Anschrift an! : &quot;; getline(cin, in_address);
    cout &lt;&lt; &quot; Wie lautet ihre Telefonnummer?     : &quot;; getline(cin, in_telnr);
    cout &lt;&lt; &quot;\n\n&quot;;

    person pers;
    pers.SetAngaben(in_name,in_nickname,in_address,in_telnr,in_age);
    pers.ShowAll();

    Save();
    cout &lt;&lt; &quot;\n\n Angaben gespeichert! &quot;;
}
</code></pre>
<p>ich weiss nicht wie ich des mit der Funktion &quot;Save()&quot; anstelle nun den termin zu saven... naja spaeter sollen erst mal wie mir beschrieben wurde, die ganzen daten eingeben und im vector lagern und dann alle nach einander speichern.... hmmm kann mir den nun mal einer helfen wies gemacht wird ????</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1090057</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1090057</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sun, 02 Jul 2006 12:13:27 GMT</pubDate></item><item><title><![CDATA[Reply to wieso geht das nicht?? on Sun, 02 Jul 2006 13:19:25 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">void Save()
{
    vector &lt;person&gt; angaben;

    angaben.push_back(); // Was soll hier rangehängt werden??

    ofstream file(&quot;C:\\testen&quot;,ios::out|ios::app);
    // ios::out nicht nötig, da ofstream

    file &lt;&lt; &quot;\n&quot; &lt;&lt; angaben.pop_back();
    close.file(); // Wenn schon andersrum: file.close(). Ist aber nicht notwendig:
                  // wird automatisch gemacht.
}
</code></pre>
<p>Einfach nur den Inhalt einer Klasse zu speichern, ist zwar möglich, aber nicht bei std::string, da er intern auch mit pointern arbeitet. Außerdem kann er ja unterschiedlich lang sein. Mein Tipp: Speicher alles immer Zeilen weise. Das sieht dann z.B. so aus:</p>
<pre><code class="language-cpp">file &lt;&lt; name &lt;&lt; std::endl &lt;&lt; nickname &lt;&lt; std::endl &lt;&lt; age.... usw.
</code></pre>
<p>Zum einlesen benutzt du getline:</p>
<pre><code class="language-cpp">std::getline(file, name); std::getline(file, nickname);...usw..
</code></pre>
<blockquote>
<p>halloo.... wie mach ich des nun mit aus dem container von nen vector daten speichern (hoffe war richtig von moA formuliert)...</p>
</blockquote>
<p>Sry hab dich nicht ganz verstanden, was willst du sagen?</p>
<p>Achja: Bitte verwende die [ c p p ]-Tags und nicht die [ c o d e ] Tags. Dann wird alles nämlich schön bunt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>mfg.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1090112</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1090112</guid><dc:creator><![CDATA[joomoo]]></dc:creator><pubDate>Sun, 02 Jul 2006 13:19:25 GMT</pubDate></item><item><title><![CDATA[Reply to wieso geht das nicht?? on Sun, 02 Jul 2006 16:41:23 GMT]]></title><description><![CDATA[<p>hmm... des mit dem einzelnt einlesen geht net... da meckert er wieder... &quot;undefin blabla&quot; .... whats to do?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1090242</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1090242</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sun, 02 Jul 2006 16:41:23 GMT</pubDate></item><item><title><![CDATA[Reply to wieso geht das nicht?? on Sun, 02 Jul 2006 17:00:03 GMT]]></title><description><![CDATA[<p>T0bi schrieb:</p>
<blockquote>
<p>hmm... des mit dem einzelnt einlesen geht net... da meckert er wieder... &quot;undefin blabla&quot; .... whats to do?</p>
</blockquote>
<p>Gaaaanz wichtig! Das schreibst du dir jetzt auf und lernst es auswendig:</p>
<p>- Source Code (der ohne Änderungen compilierbar ist) zeigen bei dem der Fehler auftritt<br />
- exakte Fehlermeldung die auftritt kopieren.</p>
<p>Und dann kannst auch noch folgendes lesen: <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-136013.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-136013.html</a></p>
<p>mfg.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1090251</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1090251</guid><dc:creator><![CDATA[joomoo]]></dc:creator><pubDate>Sun, 02 Jul 2006 17:00:03 GMT</pubDate></item><item><title><![CDATA[Reply to wieso geht das nicht?? on Sun, 02 Jul 2006 17:10:36 GMT]]></title><description><![CDATA[<blockquote>
<p>Gaaaanz wichtig! Das schreibst du dir jetzt auf und lernst es auswendig:</p>
<p>- Source Code (der ohne Änderungen compilierbar ist) zeigen bei dem der Fehler auftritt<br />
- exakte Fehlermeldung die auftritt kopieren.</p>
<p>Und dann kannst auch noch folgendes lesen: <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-136013.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-136013.html</a></p>
</blockquote>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> <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>
<p>Den Link sollte man in die FAQ setzen, wenn er noch nicht drin ist: <a href="http://www.lugbz.org/documents/smart-questions_de.html" rel="nofollow">http://www.lugbz.org/documents/smart-questions_de.html</a></p>
<p>MFG winexec*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1090263</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1090263</guid><dc:creator><![CDATA[winexec*]]></dc:creator><pubDate>Sun, 02 Jul 2006 17:10:36 GMT</pubDate></item></channel></rss>