<?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[Pointer]]></title><description><![CDATA[<p>Alles funktioniert nur bei der Funktion f bekomme ich eine Kompilerfehlermeldung.</p>
<p>Fehler E2093 w.cpp 9: 'operator*' ist im Typ 'vector&lt;int,allocator&lt;int&gt; &gt;' f³r A<br />
rgumente desselben Typs nicht implementiert in Funktion f(vector&lt;int,allocator&lt;i<br />
nt&gt; &gt; <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>Aber ich kann mit der Meldung nichts Anfangen ...</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;vector&gt;
using namespace std;

void f ( vector&lt;int&gt; * dat )
{
	cout&lt;&lt;&quot;vector: &quot; &lt;&lt; *dat[0] &lt;&lt; endl;
}

void ar ( int *var[] )
{
	cout&lt;&lt;&quot;ar: &quot; &lt;&lt; *var[0]&lt;&lt;endl;
}

void T ( int **p ) 
{

	cout&lt;&lt;&quot;**p: &quot; &lt;&lt; **p&lt;&lt;endl;
}

int main(int argc, char*argv[])
{

cout&lt;&lt;&quot;argv[0]: &quot; &lt;&lt;argv[0]&lt;&lt;endl;

vector&lt;int&gt;dd;
dd.push_back(8);
f ( &amp;dd  );

int e = 20;
int *q = &amp;e;

T ( &amp;q );
ar(&amp;q);

return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/307711/pointer</link><generator>RSS for Node</generator><lastBuildDate>Thu, 06 Aug 2026 14:07:45 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/307711.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 03 Sep 2012 09:52:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Pointer on Mon, 03 Sep 2012 09:52:19 GMT]]></title><description><![CDATA[<p>Alles funktioniert nur bei der Funktion f bekomme ich eine Kompilerfehlermeldung.</p>
<p>Fehler E2093 w.cpp 9: 'operator*' ist im Typ 'vector&lt;int,allocator&lt;int&gt; &gt;' f³r A<br />
rgumente desselben Typs nicht implementiert in Funktion f(vector&lt;int,allocator&lt;i<br />
nt&gt; &gt; <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>Aber ich kann mit der Meldung nichts Anfangen ...</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;vector&gt;
using namespace std;

void f ( vector&lt;int&gt; * dat )
{
	cout&lt;&lt;&quot;vector: &quot; &lt;&lt; *dat[0] &lt;&lt; endl;
}

void ar ( int *var[] )
{
	cout&lt;&lt;&quot;ar: &quot; &lt;&lt; *var[0]&lt;&lt;endl;
}

void T ( int **p ) 
{

	cout&lt;&lt;&quot;**p: &quot; &lt;&lt; **p&lt;&lt;endl;
}

int main(int argc, char*argv[])
{

cout&lt;&lt;&quot;argv[0]: &quot; &lt;&lt;argv[0]&lt;&lt;endl;

vector&lt;int&gt;dd;
dd.push_back(8);
f ( &amp;dd  );

int e = 20;
int *q = &amp;e;

T ( &amp;q );
ar(&amp;q);

return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2248054</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2248054</guid><dc:creator><![CDATA[_ptr**]]></dc:creator><pubDate>Mon, 03 Sep 2012 09:52:19 GMT</pubDate></item><item><title><![CDATA[Reply to Pointer on Mon, 03 Sep 2012 10:13:06 GMT]]></title><description><![CDATA[<p>_ptr** schrieb:</p>
<blockquote>
<p>Aber ich kann mit der Meldung nichts Anfangen ...</p>
</blockquote>
<p>*dat[0] heißt *(dat[0]). Jetzt besser?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2248060</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2248060</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Mon, 03 Sep 2012 10:13:06 GMT</pubDate></item><item><title><![CDATA[Reply to Pointer on Mon, 03 Sep 2012 10:21:49 GMT]]></title><description><![CDATA[<p>Nein ... ich kriegs noch immer nicht hin. -.-</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2248064</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2248064</guid><dc:creator><![CDATA[_ptr**]]></dc:creator><pubDate>Mon, 03 Sep 2012 10:21:49 GMT</pubDate></item><item><title><![CDATA[Reply to Pointer on Mon, 03 Sep 2012 10:26:30 GMT]]></title><description><![CDATA[<p>Du stolperst darüber, dass es zwei Reihenfolgen der Auswertung gibt, aber nicht diejenige, die Du denkst genommen wird (Operator-Precedence)</p>
<pre><code class="language-cpp">void f ( vector&lt;int&gt; * dat )
{
  cout&lt;&lt;&quot;vector: &quot; &lt;&lt; *dat[0] &lt;&lt; endl;  // zwei Operatoren: operator* und operator[], welcher wird zuerst ausgewertet?
  // a) [] vor *, also *(dat[0]):
  //    dat[0] ist vector&lt;int&gt;, was ist dann *(dat[0])?
  // b) * vor [], also (*dat)[0]:
  //    *dat ist auch vector&lt;int&gt;, was ist dann (*dat)[0]?
}
</code></pre>
<p>Du musst explizit klammern.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2248065</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2248065</guid><dc:creator><![CDATA[Precedence]]></dc:creator><pubDate>Mon, 03 Sep 2012 10:26:30 GMT</pubDate></item><item><title><![CDATA[Reply to Pointer on Mon, 03 Sep 2012 10:34:54 GMT]]></title><description><![CDATA[<p>Möchtest du explizit die Anwendung von Pointern testen? Oder gibt es einen anderen guten Grund, dass du den vector nicht als Referenz übergibst?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2248066</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2248066</guid><dc:creator><![CDATA[daddy_felix]]></dc:creator><pubDate>Mon, 03 Sep 2012 10:34:54 GMT</pubDate></item><item><title><![CDATA[Reply to Pointer on Mon, 03 Sep 2012 10:43:03 GMT]]></title><description><![CDATA[<p>Precedence schrieb:</p>
<blockquote>
<p>// was ist dann *(dat[0])?<br />
// <em>(dat[0]) ist vector&lt;int&gt;</em> ??<br />
// b) * vor [], also (<em>dat)[0]:<br />
// *dat ist auch vector&lt;int&gt;, was ist dann (*dat)[0]? vector&lt;int&gt;</em> ??</p>
</blockquote>
<p>So gehts jetzt jedenfalls -&gt; (*dat)[0]</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/27454">@daddy_felix</a><br />
Ich bin nur etwas am Üben was Pointer angeht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2248068</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2248068</guid><dc:creator><![CDATA[_ptr**]]></dc:creator><pubDate>Mon, 03 Sep 2012 10:43:03 GMT</pubDate></item><item><title><![CDATA[Reply to Pointer on Mon, 03 Sep 2012 11:10:16 GMT]]></title><description><![CDATA[<p>_ptr** schrieb:</p>
<blockquote>
<p>Precedence schrieb:</p>
<blockquote>
<p>// was ist dann *(dat[0])?<br />
// <em>(dat[0]) ist vector&lt;int&gt;</em> ??<br />
// b) * vor [], also (<em>dat)[0]:<br />
// *dat ist auch vector&lt;int&gt;, was ist dann (*dat)[0]? vector&lt;int&gt;</em> ??</p>
</blockquote>
</blockquote>
<ol>
<li>ist das Ergebnis von <code>vector&lt;int&gt;::operator*(vector&lt;int&gt;)</code><br />
(nicht implementiert) -&gt; Der Compilerfehler vom Anfang. d.h. so hat es Dein Compiler ohne Klammerung aufgefasst.</li>
<li>ist das Ergebnis von <code>vector&lt;int&gt;::operator[](vector&lt;int&gt;::size_type)</code> Aha! ein int&amp;...</li>
</ol>
<p>Durch die ganzen Typen ist das jetzt ein wenig unverständlich.<br />
Schau Dir eine Auflistung der Operator-Präzedenz in C++ an. Überzeug Dich, dass <code>[]</code> eher ausgewertet wird als <code>*</code> . Dann wird Dir auch klar, warum Du so klammern musst (*dat)[0].</p>
<p>hth</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2248074</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2248074</guid><dc:creator><![CDATA[Precedence]]></dc:creator><pubDate>Mon, 03 Sep 2012 11:10:16 GMT</pubDate></item></channel></rss>