<?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[[gelöst]MeinObject=null geht nicht?]]></title><description><![CDATA[<p>ich such grad nach sowas wie null (kennt ihr vllt aus Java) hab schon NULL probiert kann ich aber nur für zahlen verwenden (NULL=0^^).</p>
<p>Gibt es irgendnen &quot;null&quot; wert den ich variablen zuweisen kann ohne das deren Konstruktor aufgerufen wird?</p>
<pre><code>MeinObject test=null;
</code></pre>
<p>null halt.</p>
<p>thx for help</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/214266/gelöst-meinobject-null-geht-nicht</link><generator>RSS for Node</generator><lastBuildDate>Tue, 13 Oct 2026 17:31:13 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/214266.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 27 May 2008 12:44:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [gelöst]MeinObject=null geht nicht? on Tue, 27 May 2008 14:45:58 GMT]]></title><description><![CDATA[<p>ich such grad nach sowas wie null (kennt ihr vllt aus Java) hab schon NULL probiert kann ich aber nur für zahlen verwenden (NULL=0^^).</p>
<p>Gibt es irgendnen &quot;null&quot; wert den ich variablen zuweisen kann ohne das deren Konstruktor aufgerufen wird?</p>
<pre><code>MeinObject test=null;
</code></pre>
<p>null halt.</p>
<p>thx for help</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1517633</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1517633</guid><dc:creator><![CDATA[squareC]]></dc:creator><pubDate>Tue, 27 May 2008 14:45:58 GMT</pubDate></item><item><title><![CDATA[Reply to [gelöst]MeinObject=null geht nicht? on Tue, 27 May 2008 12:46:59 GMT]]></title><description><![CDATA[<p><code>MeinObject *obj = 0;</code></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1517638</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1517638</guid><dc:creator><![CDATA[nulla]]></dc:creator><pubDate>Tue, 27 May 2008 12:46:59 GMT</pubDate></item><item><title><![CDATA[Reply to [gelöst]MeinObject=null geht nicht? on Tue, 27 May 2008 12:47:31 GMT]]></title><description><![CDATA[<p>Geht nur mit Zeigern. MeinObject* pointer = &amp;object; pointer = NULL;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1517639</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1517639</guid><dc:creator><![CDATA[????&#96;???????]]></dc:creator><pubDate>Tue, 27 May 2008 12:47:31 GMT</pubDate></item><item><title><![CDATA[Reply to [gelöst]MeinObject=null geht nicht? on Tue, 27 May 2008 12:48:36 GMT]]></title><description><![CDATA[<p>gibts nicht so direkt</p>
<p>bei<br />
YourObject obj;<br />
wird immer der konstruktor aufgerufen</p>
<p>was du suchst is n pointer auf des objekt, das kann NULL sein</p>
<pre><code>YourObject *obj = NULL;

if(fasel)
    obj = new YourObject();

.
.
.

if(obj != NULL)
{
    delete obj;
    obj = NULL;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1517643</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1517643</guid><dc:creator><![CDATA[EXDW]]></dc:creator><pubDate>Tue, 27 May 2008 12:48:36 GMT</pubDate></item><item><title><![CDATA[Reply to [gelöst]MeinObject=null geht nicht? on Tue, 27 May 2008 13:12:39 GMT]]></title><description><![CDATA[<p>hm ich glaub dann muss ich mein Problem wohl mal genauer schildern:</p>
<p>Ich hab ein Mehrdimensionales Array, in dem werte Gespeichert sind. Bei einer Iteration sollen die &quot;null&quot; werte übersprungen werden:</p>
<pre><code>MyObject objecte[][3]=
{
	{ MyObject(), MyObject(), null },
	{ MyObject(), MyObject(), MyObject() },
	{ MyObject(), null, null }
};
</code></pre>
<p>anderer Ansatz wären verschieden lange &quot;zeilen&quot; aber da meckert der Compiler. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1517668</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1517668</guid><dc:creator><![CDATA[squareC]]></dc:creator><pubDate>Tue, 27 May 2008 13:12:39 GMT</pubDate></item><item><title><![CDATA[Reply to [gelöst]MeinObject=null geht nicht? on Tue, 27 May 2008 13:18:35 GMT]]></title><description><![CDATA[<p>Auch in einem Array kann ein Objekt nicht &quot;nichts&quot; sein. Du wirst Zeiger verwenden müssen, oder einen bestimmten Zustand des Objekts als &quot;ungültig&quot; deklarieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1517674</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1517674</guid><dc:creator><![CDATA[LordJaxom_lg]]></dc:creator><pubDate>Tue, 27 May 2008 13:18:35 GMT</pubDate></item><item><title><![CDATA[Reply to [gelöst]MeinObject=null geht nicht? on Tue, 27 May 2008 13:19:09 GMT]]></title><description><![CDATA[<p>auto-objekte werden immer automatisch erzeugt. in deinem fall musst du zeiger auf MyObject in deinem array speichern.</p>
<pre><code class="language-cpp">MyObject* objecte[][3]=
{
	{ new MyObject, new MyObject, 0 },
	{ new MyObject, new MyObject, new MyObject },
	{ new MyObject, 0, 0 }
};
</code></pre>
<p>also im prinzip das gleiche wie in java.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1517675</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1517675</guid><dc:creator><![CDATA[nulla]]></dc:creator><pubDate>Tue, 27 May 2008 13:19:09 GMT</pubDate></item><item><title><![CDATA[Reply to [gelöst]MeinObject=null geht nicht? on Tue, 27 May 2008 14:22:58 GMT]]></title><description><![CDATA[<p>nulla schrieb:</p>
<blockquote>
<p>...also im prinzip das gleiche wie in java.</p>
</blockquote>
<p>Ist sowieso so so: Das, was der Javaist &quot;Referenz&quot; nennt, ist in C++ ein Zeiger.</p>
<p>Gruß,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1517747</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1517747</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Tue, 27 May 2008 14:22:58 GMT</pubDate></item><item><title><![CDATA[Reply to [gelöst]MeinObject=null geht nicht? on Tue, 27 May 2008 14:38:23 GMT]]></title><description><![CDATA[<p>Sagt ihm in diesem Zusammenhang abre auch, dass C++ im Gegensatz zu Java keinen Garbage Collector von Haus aus mitbringt, und er alle mit new erzeugten Objekte auch wieder mit delete löschen muss.</p>
<p>MfG SideWinder</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1517765</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1517765</guid><dc:creator><![CDATA[SideWinder]]></dc:creator><pubDate>Tue, 27 May 2008 14:38:23 GMT</pubDate></item><item><title><![CDATA[Reply to [gelöst]MeinObject=null geht nicht? on Tue, 27 May 2008 14:45:38 GMT]]></title><description><![CDATA[<p>jo thx leute</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1517773</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1517773</guid><dc:creator><![CDATA[squareC]]></dc:creator><pubDate>Tue, 27 May 2008 14:45:38 GMT</pubDate></item><item><title><![CDATA[Reply to [gelöst]MeinObject=null geht nicht? on Wed, 28 May 2008 05:41:38 GMT]]></title><description><![CDATA[<p>hab ich - hab ich - #wink #fuchtel #gg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1518064</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1518064</guid><dc:creator><![CDATA[EXDW]]></dc:creator><pubDate>Wed, 28 May 2008 05:41:38 GMT</pubDate></item></channel></rss>