<?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[Class Wertzuweisung]]></title><description><![CDATA[<p>Ich habe mal wieder ein Problem und finde den Fehler mal wieder nicht <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=":/"
      alt="😕"
    /></p>
<pre><code>//main.cpp

#include &lt;iostream&gt;
#include &quot;Laden.h&quot;
using namespace std;

int main(){
    const int MAXGELD=500;
    person(MAXGELD);
    return 0;
}
</code></pre>
<pre><code>//Laden.h

#ifndef LADEN_H_INCLUDED
#define LADEN_H_INCLUDED

class person{
    public:
        person(int maxgeld)
        :geld(maxgeld){
        }
    private:
        int geld;
};

#endif // LADEN_H_INCLUDED
</code></pre>
<p>Irgendwie will das nicht so wie ich das möchte :s<br />
Ich denke die Fehlermeldungen sind hier nicht wichtig (für euch)</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/323292/class-wertzuweisung</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Jul 2026 06:52:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/323292.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 24 Jan 2014 20:46:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Class Wertzuweisung on Fri, 24 Jan 2014 20:46:31 GMT]]></title><description><![CDATA[<p>Ich habe mal wieder ein Problem und finde den Fehler mal wieder nicht <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=":/"
      alt="😕"
    /></p>
<pre><code>//main.cpp

#include &lt;iostream&gt;
#include &quot;Laden.h&quot;
using namespace std;

int main(){
    const int MAXGELD=500;
    person(MAXGELD);
    return 0;
}
</code></pre>
<pre><code>//Laden.h

#ifndef LADEN_H_INCLUDED
#define LADEN_H_INCLUDED

class person{
    public:
        person(int maxgeld)
        :geld(maxgeld){
        }
    private:
        int geld;
};

#endif // LADEN_H_INCLUDED
</code></pre>
<p>Irgendwie will das nicht so wie ich das möchte :s<br />
Ich denke die Fehlermeldungen sind hier nicht wichtig (für euch)</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2379386</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2379386</guid><dc:creator><![CDATA[Skeptar]]></dc:creator><pubDate>Fri, 24 Jan 2014 20:46:31 GMT</pubDate></item><item><title><![CDATA[Reply to Class Wertzuweisung on Fri, 24 Jan 2014 20:50:40 GMT]]></title><description><![CDATA[<p>Skeptar schrieb:</p>
<blockquote>
<p>Ich denke die Fehlermeldungen sind hier nicht wichtig (für euch)</p>
</blockquote>
<p>Aber für dich. Es sei denn du willst keine Antwort.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2379387</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2379387</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Fri, 24 Jan 2014 20:50:40 GMT</pubDate></item><item><title><![CDATA[Reply to Class Wertzuweisung on Fri, 24 Jan 2014 20:55:10 GMT]]></title><description><![CDATA[<p>Bashar schrieb:</p>
<blockquote>
<p>Aber für dich. Es sei denn du willst keine Antwort.</p>
</blockquote>
<p>Es war mir klar ich hätte es nicht reinschreiben sollen <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="😃"
    /><br />
Fehlermeldungen:</p>
<p>MAXGELD hat eine vorherige Deklaration als const int MAXGELD<br />
in Konflikt stehende Deklarattion person MAXGELD</p>
<p>werde daraus aber nicht schlau</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2379389</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2379389</guid><dc:creator><![CDATA[Skeptar]]></dc:creator><pubDate>Fri, 24 Jan 2014 20:55:10 GMT</pubDate></item><item><title><![CDATA[Reply to Class Wertzuweisung on Fri, 24 Jan 2014 21:05:18 GMT]]></title><description><![CDATA[<p>Der Compiler nimmt an, du möchtest eine Instanz von person namens MAXGELD erstellen. Diesen Irrtum kannst du beheben, indem du vor <strong>(</strong> einen Namen angibst oder die erstellte person zuweist.</p>
<pre><code>person(MAXGELD); // person MAXGELD; -&gt; Konflikt / Fehler
person a(MAXGELD); // ok
person a = person(MAXGELD); // ok
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2379391</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2379391</guid><dc:creator><![CDATA[Youka]]></dc:creator><pubDate>Fri, 24 Jan 2014 21:05:18 GMT</pubDate></item><item><title><![CDATA[Reply to Class Wertzuweisung on Sat, 25 Jan 2014 14:06:12 GMT]]></title><description><![CDATA[<p>Danke es geht <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="🙂"
    /><br />
Jedzt möchte ich dies einfach nur um eine Variable erweitern klappt aber nicht..<br />
(ich werde noch verrückt)</p>
<pre><code>#ifndef LADEN_H_INCLUDED
#define LADEN_H_INCLUDED

class person{
    public:
        person(int MAXGELD, int Preis)
        :geld(MAXGELD), preis(Preis){
        }

        /*void kauf(int anzahl){
            anzahl=anzahl;
        }*/
    private:
        int preis;
        int geld;
};

#endif // LADEN_H_INCLUDED
</code></pre>
<pre><code>#include &lt;iostream&gt;
#include &quot;Laden.h&quot;
using namespace std;

int main(){
    const int MAXGELD=500, preis=70;
    person ablauf(MAXGELD, preis);

    cout &lt;&lt; &quot;Anzahl der Hosen eingeben(stk. 70 Euro): &quot;;
    int anzahl=0;
    cin &gt;&gt; anzahl;

    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2379489</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2379489</guid><dc:creator><![CDATA[Skeptar]]></dc:creator><pubDate>Sat, 25 Jan 2014 14:06:12 GMT</pubDate></item><item><title><![CDATA[Reply to Class Wertzuweisung on Sat, 25 Jan 2014 14:36:22 GMT]]></title><description><![CDATA[<p>Fehlermeldung/-beschreibung? <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/2379501</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2379501</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Sat, 25 Jan 2014 14:36:22 GMT</pubDate></item><item><title><![CDATA[Reply to Class Wertzuweisung on Sat, 25 Jan 2014 14:44:50 GMT]]></title><description><![CDATA[<p>warnung: person::geld wird initialisiert nach<br />
Warnung: int person::preis<br />
warnung: when initialized here</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2379504</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2379504</guid><dc:creator><![CDATA[Skeptar]]></dc:creator><pubDate>Sat, 25 Jan 2014 14:44:50 GMT</pubDate></item><item><title><![CDATA[Reply to Class Wertzuweisung on Sat, 25 Jan 2014 14:54:23 GMT]]></title><description><![CDATA[<p>Das ist nur eine Warnung. Du hast behauptet, es &quot;klappt nicht&quot;.</p>
<p>Die Warnung kommt daher, dass die tatsächliche Initialisierungsreihenfolge sich immer nach der Reihenfolge richtet, in der die Variablen in der Klasse deklariert sind; nicht nach der Reihenfolge, in der sie in der Initialisierungsliste aufgeführt sind.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2379505</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2379505</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Sat, 25 Jan 2014 14:54:23 GMT</pubDate></item><item><title><![CDATA[Reply to Class Wertzuweisung on Sat, 25 Jan 2014 15:08:53 GMT]]></title><description><![CDATA[<p>Hmm danke <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="🙂"
    /><br />
Aber es hat ja nicht kompeliert -&gt; es klappt nicht (für mich)<br />
Danke für die schneller Antwort <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>
]]></description><link>https://www.c-plusplus.net/forum/post/2379507</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2379507</guid><dc:creator><![CDATA[Skeptar]]></dc:creator><pubDate>Sat, 25 Jan 2014 15:08:53 GMT</pubDate></item><item><title><![CDATA[Reply to Class Wertzuweisung on Sat, 25 Jan 2014 15:13:24 GMT]]></title><description><![CDATA[<p>Warnungen verhindern aber nicht das Compilieren, also hat es entweder compiliert oder es gab außer der Warnung noch Fehler (die du wieder unterschlagen hast <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/2379508</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2379508</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Sat, 25 Jan 2014 15:13:24 GMT</pubDate></item></channel></rss>