<?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[Was mache ich falsch ??]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich habe ein Programm geschrieben, das nur aus den Klassen SymtabEnty (.cpp und .h) und test(.cpp mit main) besteht. Eigentlich möchte ich nur in der main ein Objekt von Typ SymtabEntry erzeugen und dessen private int Wert type über die public methoden getType() und setType(int type) manipulieren. Seltsamerweise bekomme ich aber immer wieder Ferhlermeldungern von meine compiler ( Visual C++ Toolkit 2003). Ich muss irgendwo Fehler machen die mir nicht auffallen.</p>
<p>hier noch der Quellcode</p>
<pre><code class="language-cpp">// SymtabEntry.cpp
#include &quot;SymtabEntry.h&quot;

int SymtabEntry::getType() {
	return this-&gt;type;
}

void SymtabEntry::setType(int typ) {
	this-&gt;type = typ;
}
</code></pre>
<pre><code class="language-cpp">//SymtabEntry.h
#ifndef _SYMTABENTRY_
#define _SYMTABENTRY_
#define NULL 0
class SymtabEntry {
	private:
		int type;
	public:
		void setType(int typ);
		int getType();
};
#endif //_SYMTABENTRY_
</code></pre>
<pre><code class="language-cpp">//test.cpp
#include &quot;SymtabEntry.h&quot;
#include &lt;iostream&gt;
using namespace std;

int main() {
	SymtabEntry a();
	int b = 5;
    a.setType(b);
    cout &lt;&lt; a.getType() &lt;&lt; endl;

	return 0;
}
</code></pre>
<p>schon mal danke für eure Antworten.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/143948/was-mache-ich-falsch</link><generator>RSS for Node</generator><lastBuildDate>Wed, 02 Sep 2026 13:11:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/143948.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 13 Apr 2006 08:02:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Was mache ich falsch ?? on Thu, 13 Apr 2006 08:02:22 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich habe ein Programm geschrieben, das nur aus den Klassen SymtabEnty (.cpp und .h) und test(.cpp mit main) besteht. Eigentlich möchte ich nur in der main ein Objekt von Typ SymtabEntry erzeugen und dessen private int Wert type über die public methoden getType() und setType(int type) manipulieren. Seltsamerweise bekomme ich aber immer wieder Ferhlermeldungern von meine compiler ( Visual C++ Toolkit 2003). Ich muss irgendwo Fehler machen die mir nicht auffallen.</p>
<p>hier noch der Quellcode</p>
<pre><code class="language-cpp">// SymtabEntry.cpp
#include &quot;SymtabEntry.h&quot;

int SymtabEntry::getType() {
	return this-&gt;type;
}

void SymtabEntry::setType(int typ) {
	this-&gt;type = typ;
}
</code></pre>
<pre><code class="language-cpp">//SymtabEntry.h
#ifndef _SYMTABENTRY_
#define _SYMTABENTRY_
#define NULL 0
class SymtabEntry {
	private:
		int type;
	public:
		void setType(int typ);
		int getType();
};
#endif //_SYMTABENTRY_
</code></pre>
<pre><code class="language-cpp">//test.cpp
#include &quot;SymtabEntry.h&quot;
#include &lt;iostream&gt;
using namespace std;

int main() {
	SymtabEntry a();
	int b = 5;
    a.setType(b);
    cout &lt;&lt; a.getType() &lt;&lt; endl;

	return 0;
}
</code></pre>
<p>schon mal danke für eure Antworten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1036500</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1036500</guid><dc:creator><![CDATA[Patryn]]></dc:creator><pubDate>Thu, 13 Apr 2006 08:02:22 GMT</pubDate></item><item><title><![CDATA[Reply to Was mache ich falsch ?? on Thu, 13 Apr 2006 08:06:18 GMT]]></title><description><![CDATA[<p>Was sagt denn der Compiler denn genau?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1036504</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1036504</guid><dc:creator><![CDATA[BigBoomer]]></dc:creator><pubDate>Thu, 13 Apr 2006 08:06:18 GMT</pubDate></item><item><title><![CDATA[Reply to Was mache ich falsch ?? on Thu, 13 Apr 2006 08:06:24 GMT]]></title><description><![CDATA[<p>Wärst Du denn auch bitte so freundlich die Fehlermeldung niederzuschreiben, nicht jeder kauft sich gleich ein Visual C++ 2003 um Dein Programm damit zu compilieren...</p>
<p>(Erster Blick: die Klammern nach SymtabEntry a in main stören)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1036506</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1036506</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Thu, 13 Apr 2006 08:06:24 GMT</pubDate></item><item><title><![CDATA[Reply to Was mache ich falsch ?? on Thu, 13 Apr 2006 08:07:51 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>wäre nett gewesen, wenn du die Fehlermeldungen auch komplett mitangegeben hättest.</p>
<p>However, hast du die SymtabEntry.cpp auch mitkompiliert?</p>
<p>Außerdem ist dir bei der Instanzierung des Objekts ein Fehler unterlaufen:</p>
<pre><code class="language-cpp">//test.cpp
#include &quot;SymtabEntry.h&quot;
#include &lt;iostream&gt;
using namespace std;

int main() {
    //SymtabEntry a();  Keine Klammern setzen
    SymtabEntry a;

    int b = 5;
    a.setType(b);
    cout &lt;&lt; a.getType() &lt;&lt; endl;

    return 0;
}
</code></pre>
<p>MfG</p>
<p>GPC</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1036507</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1036507</guid><dc:creator><![CDATA[GPC]]></dc:creator><pubDate>Thu, 13 Apr 2006 08:07:51 GMT</pubDate></item><item><title><![CDATA[Reply to Was mache ich falsch ?? on Thu, 13 Apr 2006 08:54:56 GMT]]></title><description><![CDATA[<p>Danke für die schnelle antwort.</p>
<p>Der Visual C++ Toolkit 2003 Compiler lässt sich kostenfrei Downloaden ich benutze ihn , wie der name schno sagt, zum compilieren.</p>
<p>was die Fehlermeldunngen betrifft, so könnte das etwas schwirig erden da ich sie in einer Dos Console stehen habe. Oder kann ich Screenshots irgendwie hochladen ??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1036546</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1036546</guid><dc:creator><![CDATA[Patryn]]></dc:creator><pubDate>Thu, 13 Apr 2006 08:54:56 GMT</pubDate></item><item><title><![CDATA[Reply to Was mache ich falsch ?? on Thu, 13 Apr 2006 08:59:36 GMT]]></title><description><![CDATA[<p>Patryn schrieb:</p>
<blockquote>
<p>was die Fehlermeldunngen betrifft, so könnte das etwas schwirig erden da ich sie in einer Dos Console stehen habe. Oder kann ich Screenshots irgendwie hochladen ??</p>
</blockquote>
<p>ähm, mit der linken Maustaste den Text aus der Windows Konsole markieren, dann Enter drücken und er hat's kopiert. Alternativ kannst du über das Programm - Icon und Bearbeiten kopieren.</p>
<p>MfG</p>
<p>GPC</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1036551</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1036551</guid><dc:creator><![CDATA[GPC]]></dc:creator><pubDate>Thu, 13 Apr 2006 08:59:36 GMT</pubDate></item><item><title><![CDATA[Reply to Was mache ich falsch ?? on Thu, 13 Apr 2006 09:01:17 GMT]]></title><description><![CDATA[<blockquote>
<p>was die Fehlermeldunngen betrifft, so könnte das etwas schwirig erden da ich sie in einer Dos Console stehen habe. Oder kann ich Screenshots irgendwie hochladen ??</p>
</blockquote>
<p>Wieso kannst du keinen Text aus einer Konsole kopieren?<br />
Screen-Shot kostenlos hochladen geht (z.B.) mit <a href="http://imageshack.us/" rel="nofollow">imageshack.us</a>.</p>
<p>Gruß, Caipi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1036555</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1036555</guid><dc:creator><![CDATA[Caipi]]></dc:creator><pubDate>Thu, 13 Apr 2006 09:01:17 GMT</pubDate></item><item><title><![CDATA[Reply to Was mache ich falsch ?? on Thu, 13 Apr 2006 09:04:13 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ok das mit dem aus der Console rauscopieren kannte ich bisher noch nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1036559</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1036559</guid><dc:creator><![CDATA[Patryn]]></dc:creator><pubDate>Thu, 13 Apr 2006 09:04:13 GMT</pubDate></item><item><title><![CDATA[Reply to Was mache ich falsch ?? on Thu, 13 Apr 2006 09:11:59 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">//test.cpp
#include &quot;SymtabEntry.h&quot;
#include &lt;iostream&gt;
using namespace std;

int main() {
    SymtabEntry a; // &lt;-- hier keine Klammern
    int b = 5;
    a.setType(b);
    cout &lt;&lt; a.getType() &lt;&lt; endl;

    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1036566</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1036566</guid><dc:creator><![CDATA[0xdeadbeef]]></dc:creator><pubDate>Thu, 13 Apr 2006 09:11:59 GMT</pubDate></item><item><title><![CDATA[Reply to Was mache ich falsch ?? on Thu, 13 Apr 2006 12:53:17 GMT]]></title><description><![CDATA[<p>Im übrigen vermisse ich bei Deiner Klasse SymtabEntry den Konstruktor und somit ist der Wert von type unbestimmt.</p>
<pre><code class="language-cpp">// SymtabEntry.cpp
#include &quot;SymtabEntry.h&quot;

//Konstruktur
SymtabEntry::SymtabEntry()
{
    type = 0;
}

int SymtabEntry::getType() {
    return this-&gt;type;
}

void SymtabEntry::setType(int typ) {
    this-&gt;type = typ;
}
</code></pre>
<pre><code class="language-cpp">//SymtabEntry.h
#ifndef _SYMTABENTRY_
#define _SYMTABENTRY_
#define NULL 0
class SymtabEntry {
    private:
        int type;
    public:
        SymtabEntry(); //Konstruktor
        void setType(int typ);
        int getType();
};
#endif //_SYMTABENTRY_
</code></pre>
<p>[EDIT]<br />
Rechtschreibfehler<br />
[/EDIT]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1036754</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1036754</guid><dc:creator><![CDATA[SciFi]]></dc:creator><pubDate>Thu, 13 Apr 2006 12:53:17 GMT</pubDate></item><item><title><![CDATA[Reply to Was mache ich falsch ?? on Thu, 13 Apr 2006 13:08:43 GMT]]></title><description><![CDATA[<p>Hi!</p>
<p>Wenn mans genau nimmt sollte er dann auch die Initialisierungsliste verwenden, statt:</p>
<pre><code class="language-cpp">SymtabEntry::SymtabEntry()
{
    type = 0;
}
</code></pre>
<p>Außerdem hält er sich nicht an die Const Correctness... Naja, was solls! <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>
<p>grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1036781</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1036781</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Thu, 13 Apr 2006 13:08:43 GMT</pubDate></item><item><title><![CDATA[Reply to Was mache ich falsch ?? on Thu, 13 Apr 2006 13:10:53 GMT]]></title><description><![CDATA[<p>welche const-correctness? Hier werden nur built-ins übergeben. Da die by Value genommen werden (so soll's auch sein), ist auch kein const nötig.</p>
<p>MfG</p>
<p>GPC</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1036786</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1036786</guid><dc:creator><![CDATA[GPC]]></dc:creator><pubDate>Thu, 13 Apr 2006 13:10:53 GMT</pubDate></item><item><title><![CDATA[Reply to Was mache ich falsch ?? on Thu, 13 Apr 2006 13:30:44 GMT]]></title><description><![CDATA[<p>GPC schrieb:</p>
<blockquote>
<p>welche const-correctness? Hier werden nur built-ins übergeben. Da die by Value genommen werden (so soll's auch sein), ist auch kein const nötig.</p>
</blockquote>
<p>Hmm? Geht wohl eher um</p>
<pre><code class="language-cpp">int getType();
// statt
int getType() const;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1036811</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1036811</guid><dc:creator><![CDATA[finix]]></dc:creator><pubDate>Thu, 13 Apr 2006 13:30:44 GMT</pubDate></item><item><title><![CDATA[Reply to Was mache ich falsch ?? on Thu, 13 Apr 2006 13:33:32 GMT]]></title><description><![CDATA[<p>ach so, ja gut, das hatte ich übersehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1036816</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1036816</guid><dc:creator><![CDATA[GPC]]></dc:creator><pubDate>Thu, 13 Apr 2006 13:33:32 GMT</pubDate></item></channel></rss>