<?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[illegal call of non-static member function?? warum kommt diese fehlermeldun??]]></title><description><![CDATA[<p>ich rufe eine öffentliche memberfunktion auf, die einen integer-wert zurückgibt und bekomme jedes mal diese fehlermeldung:</p>
<pre><code>illegal call of non-static member function
</code></pre>
<p>egal was ich mache!!<br />
der funktion wird ein zeiger und ein integer wert übergeben:</p>
<pre><code class="language-cpp">Instanz::Funktion(&amp;string, integer);
</code></pre>
<p>deklariert ist die funktion ungefär so:</p>
<pre><code class="language-cpp">int CKlasse::Funktion (string *pstring, int einezahl)
{
   if(zahl&lt;counter)//der counter zählt, wie viele werte stringarray hat!
   {
       *pstring=stringarray[einezahl];
       return 0;
   }
   else 
       return 1;
}
</code></pre>
<p>warum kommt diese fehlermeldung??</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/207473/illegal-call-of-non-static-member-function-warum-kommt-diese-fehlermeldun</link><generator>RSS for Node</generator><lastBuildDate>Sun, 11 Oct 2026 06:02:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/207473.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 08 Mar 2008 08:40:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to illegal call of non-static member function?? warum kommt diese fehlermeldun?? on Sat, 08 Mar 2008 11:00:12 GMT]]></title><description><![CDATA[<p>ich rufe eine öffentliche memberfunktion auf, die einen integer-wert zurückgibt und bekomme jedes mal diese fehlermeldung:</p>
<pre><code>illegal call of non-static member function
</code></pre>
<p>egal was ich mache!!<br />
der funktion wird ein zeiger und ein integer wert übergeben:</p>
<pre><code class="language-cpp">Instanz::Funktion(&amp;string, integer);
</code></pre>
<p>deklariert ist die funktion ungefär so:</p>
<pre><code class="language-cpp">int CKlasse::Funktion (string *pstring, int einezahl)
{
   if(zahl&lt;counter)//der counter zählt, wie viele werte stringarray hat!
   {
       *pstring=stringarray[einezahl];
       return 0;
   }
   else 
       return 1;
}
</code></pre>
<p>warum kommt diese fehlermeldung??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1470396</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1470396</guid><dc:creator><![CDATA[halo]]></dc:creator><pubDate>Sat, 08 Mar 2008 11:00:12 GMT</pubDate></item><item><title><![CDATA[Reply to illegal call of non-static member function?? warum kommt diese fehlermeldun?? on Sat, 08 Mar 2008 08:43:16 GMT]]></title><description><![CDATA[<p>Des Problems Lösung steht doch schon in der Fehlermeldung.<br />
Setze ein static vor das int und gut is.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1470399</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1470399</guid><dc:creator><![CDATA[static]]></dc:creator><pubDate>Sat, 08 Mar 2008 08:43:16 GMT</pubDate></item><item><title><![CDATA[Reply to illegal call of non-static member function?? warum kommt diese fehlermeldun?? on Sat, 08 Mar 2008 09:23:19 GMT]]></title><description><![CDATA[<p>Du brauchst erstmal nen Objekt von deiner Klasse, über diesen rufst du dann deine Funktion auf :</p>
<pre><code class="language-cpp">CKlasse meinObjekt;

meinObjekt.Funktion( ... );
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1470408</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1470408</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 08 Mar 2008 09:23:19 GMT</pubDate></item><item><title><![CDATA[Reply to illegal call of non-static member function?? warum kommt diese fehlermeldun?? on Sat, 08 Mar 2008 10:26:04 GMT]]></title><description><![CDATA[<p>Das ist völliger Quatsch, wenn man eine Methode in einer Klasse als static markiert, kann man sie auch ohne ein Objekt aufrufen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1470437</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1470437</guid><dc:creator><![CDATA[static]]></dc:creator><pubDate>Sat, 08 Mar 2008 10:26:04 GMT</pubDate></item><item><title><![CDATA[Reply to illegal call of non-static member function?? warum kommt diese fehlermeldun?? on Sat, 08 Mar 2008 10:38:54 GMT]]></title><description><![CDATA[<p>static schrieb:</p>
<blockquote>
<p>...wenn man eine Methode in einer Klasse als static markiert, kann man sie auch ohne ein Objekt aufrufen.</p>
</blockquote>
<p>Diese Aussage ist zwar in sich nicht falsch, aber hier im Zusammenhang schon, weil der OP offensichtlich auf eine Instanz vonj CKlasse zugreifen will (zahl, counter, stringarray) .... und das geht natürlich nicht über static Memberfunktionen.</p>
<p>Ergo: Selber Quatsch (und zwar zweimal). :p <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>Gruß,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1470441</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1470441</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Sat, 08 Mar 2008 10:38:54 GMT</pubDate></item><item><title><![CDATA[Reply to illegal call of non-static member function?? warum kommt diese fehlermeldun?? on Sat, 08 Mar 2008 10:59:51 GMT]]></title><description><![CDATA[<p>äh ich hab ein objekt erstellt nur das hab ich da falsch gemacht moment ich änders ma</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1470448</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1470448</guid><dc:creator><![CDATA[halo]]></dc:creator><pubDate>Sat, 08 Mar 2008 10:59:51 GMT</pubDate></item></channel></rss>