<?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[vector&amp;lt;TPoint&amp;gt; planes[4];]]></title><description><![CDATA[<p>Hi,</p>
<p>Was ist hier falsch?</p>
<p>Im header steht<br />
vector&lt;TPoint&gt; planes[4];</p>
<p>in der cpp:</p>
<pre><code class="language-cpp">for(long x=225; x&lt;530; x=x+46){
        for(long y=23; y&lt;330; y=y+46){
            TPoint p[4];
            p[0].x = x;
            p[0].y = y;
            p[1].x = x+43;
            p[1].y = y;
            p[2].x = x+43;
            p[2].y = y+43;
            p[3].x = x;
            p[3].y = y+43;
            planes-&gt;push_back(*p);
        }
    }
</code></pre>
<p>Wenn ich mit ShowMessage folgende ausgabe</p>
<p>z.B ShowMessage(planes[1][1].y);<br />
gibt eine AccsessViolation aus</p>
<p>z.B ShowMessage(planes[6][1].y);<br />
Kein Fehler gibt aber 49332 aus</p>
<p>Merkwürdigerweise kann ich auch<br />
ShowMessage(planes[7][7].y); ausgaben<br />
Kein Fehler gibt aber 272135028 aus</p>
<p>Verstehe ich nicht. Der Vector sollte doch 49 groß sein<br />
4 TPoints jeweils</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/114008/vector-lt-tpoint-gt-planes-4</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 14:06:28 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/114008.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 29 Jun 2005 11:22:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to vector&amp;lt;TPoint&amp;gt; planes[4]; on Wed, 29 Jun 2005 11:22:04 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>Was ist hier falsch?</p>
<p>Im header steht<br />
vector&lt;TPoint&gt; planes[4];</p>
<p>in der cpp:</p>
<pre><code class="language-cpp">for(long x=225; x&lt;530; x=x+46){
        for(long y=23; y&lt;330; y=y+46){
            TPoint p[4];
            p[0].x = x;
            p[0].y = y;
            p[1].x = x+43;
            p[1].y = y;
            p[2].x = x+43;
            p[2].y = y+43;
            p[3].x = x;
            p[3].y = y+43;
            planes-&gt;push_back(*p);
        }
    }
</code></pre>
<p>Wenn ich mit ShowMessage folgende ausgabe</p>
<p>z.B ShowMessage(planes[1][1].y);<br />
gibt eine AccsessViolation aus</p>
<p>z.B ShowMessage(planes[6][1].y);<br />
Kein Fehler gibt aber 49332 aus</p>
<p>Merkwürdigerweise kann ich auch<br />
ShowMessage(planes[7][7].y); ausgaben<br />
Kein Fehler gibt aber 272135028 aus</p>
<p>Verstehe ich nicht. Der Vector sollte doch 49 groß sein<br />
4 TPoints jeweils</p>
]]></description><link>https://www.c-plusplus.net/forum/post/819675</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/819675</guid><dc:creator><![CDATA[Trulli]]></dc:creator><pubDate>Wed, 29 Jun 2005 11:22:04 GMT</pubDate></item><item><title><![CDATA[Reply to vector&amp;lt;TPoint&amp;gt; planes[4]; on Wed, 29 Jun 2005 11:26:30 GMT]]></title><description><![CDATA[<p>Was du da oben deklariert hast ist ein statisches Array mit 4 Elementen vom Typ vector&lt;TPoint&gt;. Du wolltest bestimmt einen vector auf ein statisches Array von TPoint mit 4 Elementen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/819680</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/819680</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Wed, 29 Jun 2005 11:26:30 GMT</pubDate></item><item><title><![CDATA[Reply to vector&amp;lt;TPoint&amp;gt; planes[4]; on Wed, 29 Jun 2005 11:29:00 GMT]]></title><description><![CDATA[<p>Wo müsste in diesem Fall die 4 hin?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/819684</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/819684</guid><dc:creator><![CDATA[Trulli]]></dc:creator><pubDate>Wed, 29 Jun 2005 11:29:00 GMT</pubDate></item><item><title><![CDATA[Reply to vector&amp;lt;TPoint&amp;gt; planes[4]; on Wed, 29 Jun 2005 11:37:50 GMT]]></title><description><![CDATA[<p>Das müßte dann eher so aussehen: vector&lt;TPoint[4]&gt;<br />
Wobei so etwas wahrscheinlich garnicht funktioniert. Ich würde auch keine statischen Arrays in einen vector packen. Enweder dynamische Array (wenn sie sehr groß werden) oder in deinem Fall lieber eine struct, die 4 mal TPoint enthält.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/819695</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/819695</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Wed, 29 Jun 2005 11:37:50 GMT</pubDate></item><item><title><![CDATA[Reply to vector&amp;lt;TPoint&amp;gt; planes[4]; on Wed, 29 Jun 2005 11:41:13 GMT]]></title><description><![CDATA[<p>Das mit der struct habe ich auch schon gemacht. Bleibe jetzt auch dabei.</p>
<p>Im header</p>
<pre><code class="language-cpp">typedef struct TagPlanes 
        {
            TPoint a,b,c,d;
        }TPlanes;
        vector&lt;TPlanes&gt; planes;
</code></pre>
<p>cpp</p>
<pre><code class="language-cpp">for(long x=225; x&lt;530; x=x+46){
        for(long y=23; y&lt;330; y=y+46){
            TPlanes p;
            p.a.x = x;
            p.a.y = y;
            p.b.x = x+43;
            p.b.y = y;
            p.c.x = x+43;
            p.c.y = y+43;
            p.d.x = x;
            p.d.y = y+43;
            planes.push_back(p);
        }
    }
</code></pre>
<p>Dank für die Antworten</p>
]]></description><link>https://www.c-plusplus.net/forum/post/819700</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/819700</guid><dc:creator><![CDATA[Trulli]]></dc:creator><pubDate>Wed, 29 Jun 2005 11:41:13 GMT</pubDate></item><item><title><![CDATA[Reply to vector&amp;lt;TPoint&amp;gt; planes[4]; on Wed, 29 Jun 2005 11:44:09 GMT]]></title><description><![CDATA[<p>Bloß als Hinweis. Das hier:</p>
<pre><code class="language-cpp">typedef struct TagPlanes
{
  TPoint a,b,c,d;
}TPlanes;
</code></pre>
<p>ist C-typisch. In C++ macht man das eher so:</p>
<pre><code class="language-cpp">struct TPlanes
{
   TPoint a,b,c,d;
};
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/819702</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/819702</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Wed, 29 Jun 2005 11:44:09 GMT</pubDate></item></channel></rss>