<?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[Kein Standard?]]></title><description><![CDATA[<pre><code class="language-cpp">class BASIS
{
protected:
	int i;
};

class KIND : public BASIS
{
	void Funktion(BASIS* other)
	{ i = other-&gt;i; }
};
</code></pre>
<p>Gibt mit VC++ 6.0 den Fehler:</p>
<pre><code>c:\testobj.h(133) : error C2248: 'i' : cannot access protected member declared in class 'BASIS'
        c:\msdev\gpi200\wfleisch\fleischobj.h(127) : see declaration of 'i'
</code></pre>
<p>Aber warum??</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/133288/kein-standard</link><generator>RSS for Node</generator><lastBuildDate>Thu, 27 Aug 2026 20:33:48 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/133288.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 16 Jan 2006 16:33:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Kein Standard? on Mon, 16 Jan 2006 16:33:20 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">class BASIS
{
protected:
	int i;
};

class KIND : public BASIS
{
	void Funktion(BASIS* other)
	{ i = other-&gt;i; }
};
</code></pre>
<p>Gibt mit VC++ 6.0 den Fehler:</p>
<pre><code>c:\testobj.h(133) : error C2248: 'i' : cannot access protected member declared in class 'BASIS'
        c:\msdev\gpi200\wfleisch\fleischobj.h(127) : see declaration of 'i'
</code></pre>
<p>Aber warum??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/968214</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/968214</guid><dc:creator><![CDATA[Krösus]]></dc:creator><pubDate>Mon, 16 Jan 2006 16:33:20 GMT</pubDate></item><item><title><![CDATA[Reply to Kein Standard? on Mon, 16 Jan 2006 16:38:52 GMT]]></title><description><![CDATA[<p>Weil &quot;other&quot; nicht &quot;this&quot; ist.<br />
Die Instanz 'this' erbt i von seiner Basis-Klasse. Other ist aber ein ganz andere Instanz und da gelten auch die üblichen Regeln: auf Protected darfst Du nicht zugreifen.</p>
<p>Du könntest hingehen und BASIS erklären, dass KIND eine friend class ist.</p>
<pre><code class="language-cpp">class BASIS
{
  friend class KIND;
protected:
	int i;
};
</code></pre>
<p>Dann würde es gehen, weil KIND auf alle (inkl. der private) Member von BASIS zugreifen darf.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/968216</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/968216</guid><dc:creator><![CDATA[Xin]]></dc:creator><pubDate>Mon, 16 Jan 2006 16:38:52 GMT</pubDate></item><item><title><![CDATA[Reply to Kein Standard? on Mon, 16 Jan 2006 16:42:39 GMT]]></title><description><![CDATA[<p>Vielen Dank!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/968219</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/968219</guid><dc:creator><![CDATA[Krösus]]></dc:creator><pubDate>Mon, 16 Jan 2006 16:42:39 GMT</pubDate></item><item><title><![CDATA[Reply to Kein Standard? on Mon, 16 Jan 2006 16:44:25 GMT]]></title><description><![CDATA[<p>Also meiner Meinung nach sollte es so funktionieren, und wenn KIND als friend deklariert ist, kann es trotzdem nur auf protected Members zugreifen und nicht auf private.<br />
Schreib die Funktion mal in einer seperaten Quellcode Datei, höchstwahr. ist es wieder nur ein VC 6.0 typischer Fehler.</p>
<p>Kann natürlich auch sein, dass ich ein totales Blackout habe und Krösus vollkommen recht hat <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/968221</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/968221</guid><dc:creator><![CDATA[basc_work__]]></dc:creator><pubDate>Mon, 16 Jan 2006 16:44:25 GMT</pubDate></item><item><title><![CDATA[Reply to Kein Standard? on Mon, 16 Jan 2006 16:49:03 GMT]]></title><description><![CDATA[<p>Gern geschehen.</p>
<p>friend sollte man allerdings sparsam bis gar nicht verwenden.</p>
<p>Für einen Programmierer sind zuviele Friends keine gute Sache, das untergräbt die Autorität der Programmiersprache. ;-&gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/968223</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/968223</guid><dc:creator><![CDATA[Xin]]></dc:creator><pubDate>Mon, 16 Jan 2006 16:49:03 GMT</pubDate></item><item><title><![CDATA[Reply to Kein Standard? on Mon, 16 Jan 2006 19:11:01 GMT]]></title><description><![CDATA[<p>Xin schrieb:</p>
<blockquote>
<p>Weil &quot;other&quot; nicht &quot;this&quot; ist.</p>
</blockquote>
<p>wieso funktioniert dann</p>
<pre><code class="language-cpp">class a
{
    private:
        int b;
    public:
        void a(a * other)
            { b = other -&gt; b; }
};
</code></pre>
<p>???</p>
<p>ich denke auch, dass das ein bug ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/968312</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/968312</guid><dc:creator><![CDATA[nieder mit vc6]]></dc:creator><pubDate>Mon, 16 Jan 2006 19:11:01 GMT</pubDate></item><item><title><![CDATA[Reply to Kein Standard? on Mon, 16 Jan 2006 20:07:29 GMT]]></title><description><![CDATA[<p>Das ist kein Bug, das ist tatsächlich bei protected so.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/968361</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/968361</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Mon, 16 Jan 2006 20:07:29 GMT</pubDate></item><item><title><![CDATA[Reply to Kein Standard? on Mon, 16 Jan 2006 20:32:59 GMT]]></title><description><![CDATA[<p>Bashar schrieb:</p>
<blockquote>
<p>Das ist kein Bug, das ist tatsächlich bei protected so.</p>
</blockquote>
<p>hmm. der g++ schluckt das.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/968401</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/968401</guid><dc:creator><![CDATA[c++0xcafebabe]]></dc:creator><pubDate>Mon, 16 Jan 2006 20:32:59 GMT</pubDate></item><item><title><![CDATA[Reply to Kein Standard? on Mon, 16 Jan 2006 20:59:42 GMT]]></title><description><![CDATA[<p>c++0xcafebabe schrieb:</p>
<blockquote>
<p>Bashar schrieb:</p>
<blockquote>
<p>Das ist kein Bug, das ist tatsächlich bei protected so.</p>
</blockquote>
<p>hmm. der g++ schluckt das.</p>
</blockquote>
<p>protected.cpp: In member function <code>void KIND::Funktion(BASIS*)': protected.cpp:4: error:</code>int BASIS::i' is protected<br />
protected.cpp:10: error: within this context</p>
<p><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/968438</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/968438</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Mon, 16 Jan 2006 20:59:42 GMT</pubDate></item><item><title><![CDATA[Reply to Kein Standard? on Mon, 16 Jan 2006 21:03:37 GMT]]></title><description><![CDATA[<p>Bashar schrieb:</p>
<blockquote>
<p>c++0xcafebabe schrieb:</p>
<blockquote>
<p>Bashar schrieb:</p>
<blockquote>
<p>Das ist kein Bug, das ist tatsächlich bei protected so.</p>
</blockquote>
<p>hmm. der g++ schluckt das.</p>
</blockquote>
<p>protected.cpp:10: error: within this context</p>
</blockquote>
<p>Es geht um g++... da ist das Kompilierverhalten versionsabhängig... ich kompiliere auch mit g++, ich kenne diese &lt;zyn&gt;Späße&lt;/zyn&gt;...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/968443</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/968443</guid><dc:creator><![CDATA[Xin]]></dc:creator><pubDate>Mon, 16 Jan 2006 21:03:37 GMT</pubDate></item><item><title><![CDATA[Reply to Kein Standard? on Mon, 16 Jan 2006 21:10:08 GMT]]></title><description><![CDATA[<p>Xin schrieb:</p>
<blockquote>
<p>da ist das Kompilierverhalten versionsabhängig...</p>
</blockquote>
<p>Inwiefern? Die werden doch nicht absichtlich in neueren Versionen solche Fehler einbauen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/968448</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/968448</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Mon, 16 Jan 2006 21:10:08 GMT</pubDate></item><item><title><![CDATA[Reply to Kein Standard? on Mon, 16 Jan 2006 21:10:12 GMT]]></title><description><![CDATA[<p>Xin schrieb:</p>
<blockquote>
<p>Die Instanz 'this' erbt i von seiner Basis-Klasse. Other ist aber ein ganz andere Instanz</p>
</blockquote>
<p>es geht nicht nicht, weil other eine andere instanz ist, sondern weil other vom typ BASIS* ist. mit KIND* würde es gehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/968449</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/968449</guid><dc:creator><![CDATA[ph34r with gr34t ph34r]]></dc:creator><pubDate>Mon, 16 Jan 2006 21:10:12 GMT</pubDate></item><item><title><![CDATA[Reply to Kein Standard? on Mon, 16 Jan 2006 21:11:17 GMT]]></title><description><![CDATA[<p>Bashar schrieb:</p>
<blockquote>
<p>Xin schrieb:</p>
<blockquote>
<p>da ist das Kompilierverhalten versionsabhängig...</p>
</blockquote>
<p>Inwiefern? Die werden doch nicht absichtlich in neueren Versionen solche Fehler einbauen.</p>
</blockquote>
<p>sorry, war mein fehler. gibt doch nen fehler.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/968450</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/968450</guid><dc:creator><![CDATA[c++0xcafebabe]]></dc:creator><pubDate>Mon, 16 Jan 2006 21:11:17 GMT</pubDate></item></channel></rss>