<?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[Variablen Problem]]></title><description><![CDATA[<p>Hi<br />
ich muss für die schule ein programm schreiben bekomme gerade aber einen fehler den ich nicht zuordnen kann:</p>
<p>Das ist meine headerdatei: statistic.h</p>
<pre><code>#pragma once

ref class statistic
{

public:
	int r_a,wrong_addition,right_substraction,wrong_substraction,right_multiple,wrong_multiple;
	int right_dividation,wrong_dividation;
	statistic(void);
	void set_right_addition();
	void set_right_substraction();
	void set_right_multiple();
	void set_right_dividation();
	void set_wrong_addition();
	void set_wrong_substraction();
	void set_wrong_multiple();
	void set_wrong_dividation();
	int get_right_addition();
	int get_right_substraction();
	int get_right_multiple();
	int get_right_dividation();
	int get_wrong_addition();
	int get_wrong_substraction();
	int get_wrong_multiple();
	int get_wrong_dividation();
	void set();
};
</code></pre>
<p>und das meine .cpp:</p>
<pre><code>#include &quot;StdAfx.h&quot;
#include &quot;statistic.h&quot;

statistic::statistic(void)
{
}

void statistic::set_right_addition()
{
	r_a += 1;
}

void statistic::set_right_substraction()
{
	right_substraction++;
}

void statistic::set_right_multiple()
{
	right_substraction++;
}

void statistic::set_right_dividation()
{
	right_dividation++;
}

void statistic::set_wrong_addition()
{
	wrong_addition++;
}

void statistic::set_wrong_substraction()
{
	wrong_substraction++;
}

void statistic::set_wrong_multiple()
{
	wrong_multiple++;
}

void statistic::set_wrong_dividation()
{
	wrong_dividation++;
}

int statistic::get_right_addition()
{
	return r_a;
}

int statistic::get_right_substraction()
{
	return right_substraction;
}

int statistic::get_right_multiple()
{
	return right_multiple;
}

int statistic::get_right_dividation()
{
	return right_dividation;
}

int statistic::get_wrong_addition()
{
	return wrong_addition;
}

int statistic::get_wrong_substraction()
{
	return wrong_substraction;
}

int statistic::get_wrong_multiple()
{
	return wrong_multiple;
}

int statistic::get_wrong_dividation()
{
	return wrong_dividation;
}

void statistic::set()
{
	r_a = 0;
	wrong_addition = 0;
	right_substraction = 0;
	wrong_substraction = 0;
	right_multiple = 0;
	wrong_multiple = 0;
	right_dividation = 0;
	wrong_dividation = 0;
}
</code></pre>
<p>die funktion set() wird im konstruktor der form1 aufgerufen während dessen schmiert das programm ab mit der fehlermeldeung:</p>
<blockquote>
<p>Eine Ausnahme (erste Chance) des Typs &quot;System.NullReferenceException&quot; ist in RechenLernProgram.exe aufgetreten.<br />
Eine nicht behandelte Ausnahme des Typs &quot;System.NullReferenceException&quot; ist in RechenLernProgram.exe aufgetreten.</p>
<p>Zusätzliche Informationen: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.</p>
<p>Das Programm &quot;[13516] RechenLernProgram.exe: Verwaltet&quot; wurde mit Code -1073741819 (0xc0000005) beendet.</p>
</blockquote>
<p>mit verweis auf die zeile:</p>
<pre><code>r_a = 0;
</code></pre>
<p>ich bin gerade echt am verzweifeln kann mir da jemand helfen?<br />
wenn mehr code(teile) benötigt werden einfach sagen!<br />
MfG<br />
checkprogramm</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/312370/variablen-problem</link><generator>RSS for Node</generator><lastBuildDate>Sun, 02 Aug 2026 20:36:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/312370.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 03 Jan 2013 09:35:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Variablen Problem on Thu, 03 Jan 2013 09:35:13 GMT]]></title><description><![CDATA[<p>Hi<br />
ich muss für die schule ein programm schreiben bekomme gerade aber einen fehler den ich nicht zuordnen kann:</p>
<p>Das ist meine headerdatei: statistic.h</p>
<pre><code>#pragma once

ref class statistic
{

public:
	int r_a,wrong_addition,right_substraction,wrong_substraction,right_multiple,wrong_multiple;
	int right_dividation,wrong_dividation;
	statistic(void);
	void set_right_addition();
	void set_right_substraction();
	void set_right_multiple();
	void set_right_dividation();
	void set_wrong_addition();
	void set_wrong_substraction();
	void set_wrong_multiple();
	void set_wrong_dividation();
	int get_right_addition();
	int get_right_substraction();
	int get_right_multiple();
	int get_right_dividation();
	int get_wrong_addition();
	int get_wrong_substraction();
	int get_wrong_multiple();
	int get_wrong_dividation();
	void set();
};
</code></pre>
<p>und das meine .cpp:</p>
<pre><code>#include &quot;StdAfx.h&quot;
#include &quot;statistic.h&quot;

statistic::statistic(void)
{
}

void statistic::set_right_addition()
{
	r_a += 1;
}

void statistic::set_right_substraction()
{
	right_substraction++;
}

void statistic::set_right_multiple()
{
	right_substraction++;
}

void statistic::set_right_dividation()
{
	right_dividation++;
}

void statistic::set_wrong_addition()
{
	wrong_addition++;
}

void statistic::set_wrong_substraction()
{
	wrong_substraction++;
}

void statistic::set_wrong_multiple()
{
	wrong_multiple++;
}

void statistic::set_wrong_dividation()
{
	wrong_dividation++;
}

int statistic::get_right_addition()
{
	return r_a;
}

int statistic::get_right_substraction()
{
	return right_substraction;
}

int statistic::get_right_multiple()
{
	return right_multiple;
}

int statistic::get_right_dividation()
{
	return right_dividation;
}

int statistic::get_wrong_addition()
{
	return wrong_addition;
}

int statistic::get_wrong_substraction()
{
	return wrong_substraction;
}

int statistic::get_wrong_multiple()
{
	return wrong_multiple;
}

int statistic::get_wrong_dividation()
{
	return wrong_dividation;
}

void statistic::set()
{
	r_a = 0;
	wrong_addition = 0;
	right_substraction = 0;
	wrong_substraction = 0;
	right_multiple = 0;
	wrong_multiple = 0;
	right_dividation = 0;
	wrong_dividation = 0;
}
</code></pre>
<p>die funktion set() wird im konstruktor der form1 aufgerufen während dessen schmiert das programm ab mit der fehlermeldeung:</p>
<blockquote>
<p>Eine Ausnahme (erste Chance) des Typs &quot;System.NullReferenceException&quot; ist in RechenLernProgram.exe aufgetreten.<br />
Eine nicht behandelte Ausnahme des Typs &quot;System.NullReferenceException&quot; ist in RechenLernProgram.exe aufgetreten.</p>
<p>Zusätzliche Informationen: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.</p>
<p>Das Programm &quot;[13516] RechenLernProgram.exe: Verwaltet&quot; wurde mit Code -1073741819 (0xc0000005) beendet.</p>
</blockquote>
<p>mit verweis auf die zeile:</p>
<pre><code>r_a = 0;
</code></pre>
<p>ich bin gerade echt am verzweifeln kann mir da jemand helfen?<br />
wenn mehr code(teile) benötigt werden einfach sagen!<br />
MfG<br />
checkprogramm</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2285558</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2285558</guid><dc:creator><![CDATA[checkprogramm]]></dc:creator><pubDate>Thu, 03 Jan 2013 09:35:13 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen Problem on Thu, 03 Jan 2013 09:42:35 GMT]]></title><description><![CDATA[<p>.. liegt wahrscheinlich daran, dass das Objekt 'statistic' gar nicht existiert. Zeig mal den Aufruf in 'form1'.<br />
BTW.: das ist kein C++</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2285560</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2285560</guid><dc:creator><![CDATA[Werner_logoff]]></dc:creator><pubDate>Thu, 03 Jan 2013 09:42:35 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen Problem on Thu, 03 Jan 2013 09:55:45 GMT]]></title><description><![CDATA[<p>Aufgerufen wird es im Konstruktor mit:</p>
<pre><code>s-&gt;set();
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2285570</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2285570</guid><dc:creator><![CDATA[checkprogramm]]></dc:creator><pubDate>Thu, 03 Jan 2013 09:55:45 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen Problem on Thu, 03 Jan 2013 09:56:32 GMT]]></title><link>https://www.c-plusplus.net/forum/post/2285571</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2285571</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Thu, 03 Jan 2013 09:56:32 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen Problem on Thu, 03 Jan 2013 10:09:53 GMT]]></title><description><![CDATA[<p>checkprogramm schrieb:</p>
<blockquote>
<p>Aufgerufen wird es im Konstruktor mit:</p>
<pre><code>s-&gt;set();
</code></pre>
</blockquote>
<p>nein, wird es nicht. der Konstruktor ist leer.</p>
<p>oder redest du etwa von irgendeinem anderen Konstruktor, den du hier noch gar nicht gepostet 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/2285581</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2285581</guid><dc:creator><![CDATA[daddy_felix]]></dc:creator><pubDate>Thu, 03 Jan 2013 10:09:53 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen Problem on Thu, 03 Jan 2013 10:14:34 GMT]]></title><description><![CDATA[<pre><code>Form1(void)
		{
			InitializeComponent();
			//
			//TODO: Konstruktorcode hier hinzufügen.
			//
			label1-&gt;Visible = false;
			textBox2-&gt;Visible = false;
			pictureBox1-&gt;Visible = false;
			pictureBox2-&gt;Visible = false;
			pictureBox3-&gt;Visible = false;
			pictureBox4-&gt;Visible = false;
			r = gcnew rechnen(this);
			MessageBox::Show(&quot;Zahlenbereich bitte eingeben und \&quot;Einstellung anwenden\&quot; klicken! (Standart: 20)&quot;);
			r-&gt;set_Number_Amount();
			s-&gt;set();
		}
</code></pre>
<p>das ist der komplette konstruktorcode</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2285585</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2285585</guid><dc:creator><![CDATA[checkprogramm]]></dc:creator><pubDate>Thu, 03 Jan 2013 10:14:34 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen Problem on Thu, 03 Jan 2013 10:20:00 GMT]]></title><description><![CDATA[<p>Wie ist &quot;s&quot; deklariert und wo wird es erzeugt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2285589</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2285589</guid><dc:creator><![CDATA[daddy_felix]]></dc:creator><pubDate>Thu, 03 Jan 2013 10:20:00 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen Problem on Thu, 03 Jan 2013 10:28:11 GMT]]></title><description><![CDATA[<p>erzeugt wird es zwar weiter unten aber das ist kein problem, da die funktion azfgerufen wird und es danach erst crashed...<br />
Aber so wirds erzeugt:</p>
<pre><code>statistic^ s;
</code></pre>
<p>erzeut in der pragma endregion</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2285596</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2285596</guid><dc:creator><![CDATA[checkprogramm]]></dc:creator><pubDate>Thu, 03 Jan 2013 10:28:11 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen Problem on Thu, 03 Jan 2013 10:34:17 GMT]]></title><description><![CDATA[<p>Was bedeutet das &quot;^&quot;? Ist das irgendwas neues aus C++11? Ich vermute, das ist sowas ähnliches wie ein Pointer bzw. eine Referenz. Dann funktioniert dein Code nicht, weil s nicht auf ein gültiges Objekt zeigt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2285601</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2285601</guid><dc:creator><![CDATA[daddy_felix]]></dc:creator><pubDate>Thu, 03 Jan 2013 10:34:17 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen Problem on Thu, 03 Jan 2013 10:43:26 GMT]]></title><description><![CDATA[<p>daddy_felix schrieb:</p>
<blockquote>
<p>Was bedeutet das &quot;^&quot;? Ist das irgendwas neues aus C++11? Ich vermute, das ist sowas ähnliches wie ein Pointer bzw. eine Referenz. Dann funktioniert dein Code nicht, weil s nicht auf ein gültiges Objekt zeigt.</p>
</blockquote>
<p>Das ist - wie Werner bereits angedeutet hat - kein C++.<br />
Sondern AFAIK C++/CLI.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2285608</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2285608</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Thu, 03 Jan 2013 10:43:26 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen Problem on Thu, 03 Jan 2013 10:45:47 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p>Das ist - wie Werner bereits angedeutet hat - kein C++.<br />
Sondern AFAIK C++/CLI.</p>
</blockquote>
<p>Danke. Den Einwand von Werner hatte ich gar nicht mehr auf dem Schirm...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2285609</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2285609</guid><dc:creator><![CDATA[daddy_felix]]></dc:creator><pubDate>Thu, 03 Jan 2013 10:45:47 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen Problem on Thu, 03 Jan 2013 15:19:49 GMT]]></title><description><![CDATA[<p>ja es ist ein pointer ich hatte nicht gesehen dass man auch C++/CLI-Quotes machen kann... aber weiß jetzt jemand wie ich dieses problem beheben kann?<br />
wie gesagt die funktion wird aufgerufen bis da hin klappt alles erst wenn die variable r_a den wert 0 bekommen soll gibt es den fehler...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2285777</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2285777</guid><dc:creator><![CDATA[checkprogramm]]></dc:creator><pubDate>Thu, 03 Jan 2013 15:19:49 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen Problem on Thu, 03 Jan 2013 15:27:29 GMT]]></title><description><![CDATA[<p>ein Pointer muss auf ein Objekt zeigen. Entweder übergibst du irgendwo ein Objekt, auf das s dann zeigen kann, oder du musst selbst eines erzeugen.</p>
<p>Warum brauchst du da überhaupt einen Pointer?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2285779</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2285779</guid><dc:creator><![CDATA[daddy_felix]]></dc:creator><pubDate>Thu, 03 Jan 2013 15:27:29 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen Problem on Thu, 03 Jan 2013 17:29:19 GMT]]></title><description><![CDATA[<p>checkprogramm schrieb:</p>
<blockquote>
<p>... ich hatte nicht gesehen dass man auch C++/CLI-Quotes machen kann....</p>
</blockquote>
<p>Es gibt sogar ein eigenes C++/CLI unterforum</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2285825</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2285825</guid><dc:creator><![CDATA[DirkB]]></dc:creator><pubDate>Thu, 03 Jan 2013 17:29:19 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen Problem on Thu, 03 Jan 2013 17:35:24 GMT]]></title><description><![CDATA[<p>In der schule haben wirs so gelernt dass man so halt die funktionen anderer klassen aufrufen soll ich weiß dass das was wir lernen eh nich so der gute stil ist zu programieren aber ich bin grad dabei ein buch durchzuarbeiten um es gescheit zu lernen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2285828</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2285828</guid><dc:creator><![CDATA[checkprogramm]]></dc:creator><pubDate>Thu, 03 Jan 2013 17:35:24 GMT</pubDate></item></channel></rss>