<?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[Zweidimensionaler Vector dynamisch erzeugen.]]></title><description><![CDATA[<p>Gegeben sind 3 Gruppen mit dazugehörigen linien, welche ich alle in einem vector speicher. Ich greife mittels Sectionlines[i] auf die einzelnen Linien zu.</p>
<p>bisher:</p>
<pre><code>vector&lt;pfcOutline2D_ptr&gt; Sectionlines;
</code></pre>
<p>ich würde gerne einen zweidimensionalen Vector erstellen, sodass ich bequem mit:</p>
<p>Sectionlines[1][i}-&gt;<br />
Sectionlines[2][i]-&gt;<br />
Sectionlines[3][i]-&gt;</p>
<p>mit der ersten Zahl auf die jeweilige Gruppe zugreife und mit der zweiten auf die Linienelemente</p>
<p>klappt nicht :</p>
<pre><code>vector&lt;vector&lt;int,pfcOutline2D_ptr&gt; &gt; Sectionlines;
</code></pre>
<pre><code>for (i = 0; i &lt; Gruppen.size(); i++)// Gruppendurchlaufen
	{
		for (k = 0; k &lt; SectionEntities[i]-&gt;getarraysize(); k++)//wenn datentyp linie ist, dann in Sectionlines speichern.
		{
			if (strcmp(SectionEntities[i]-&gt;get(k)-&gt;getCipTypeName(), &quot;wfcSection::SectionEntityLine&quot;) == 0)
			{
				Sectionlines.push_back(wfcSectionEntityLine::cast(SectionEntities[i]-&gt;get(k))-&gt;GetLine());
			}
		}
	}
</code></pre>
<p>Dankeschön ! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/330704/zweidimensionaler-vector-dynamisch-erzeugen</link><generator>RSS for Node</generator><lastBuildDate>Thu, 02 Jul 2026 22:50:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/330704.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 22 Jan 2015 18:23:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zweidimensionaler Vector dynamisch erzeugen. on Thu, 22 Jan 2015 18:24:04 GMT]]></title><description><![CDATA[<p>Gegeben sind 3 Gruppen mit dazugehörigen linien, welche ich alle in einem vector speicher. Ich greife mittels Sectionlines[i] auf die einzelnen Linien zu.</p>
<p>bisher:</p>
<pre><code>vector&lt;pfcOutline2D_ptr&gt; Sectionlines;
</code></pre>
<p>ich würde gerne einen zweidimensionalen Vector erstellen, sodass ich bequem mit:</p>
<p>Sectionlines[1][i}-&gt;<br />
Sectionlines[2][i]-&gt;<br />
Sectionlines[3][i]-&gt;</p>
<p>mit der ersten Zahl auf die jeweilige Gruppe zugreife und mit der zweiten auf die Linienelemente</p>
<p>klappt nicht :</p>
<pre><code>vector&lt;vector&lt;int,pfcOutline2D_ptr&gt; &gt; Sectionlines;
</code></pre>
<pre><code>for (i = 0; i &lt; Gruppen.size(); i++)// Gruppendurchlaufen
	{
		for (k = 0; k &lt; SectionEntities[i]-&gt;getarraysize(); k++)//wenn datentyp linie ist, dann in Sectionlines speichern.
		{
			if (strcmp(SectionEntities[i]-&gt;get(k)-&gt;getCipTypeName(), &quot;wfcSection::SectionEntityLine&quot;) == 0)
			{
				Sectionlines.push_back(wfcSectionEntityLine::cast(SectionEntities[i]-&gt;get(k))-&gt;GetLine());
			}
		}
	}
</code></pre>
<p>Dankeschön ! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2439109</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2439109</guid><dc:creator><![CDATA[maniche]]></dc:creator><pubDate>Thu, 22 Jan 2015 18:24:04 GMT</pubDate></item><item><title><![CDATA[Reply to Zweidimensionaler Vector dynamisch erzeugen. on Thu, 22 Jan 2015 18:43:32 GMT]]></title><description><![CDATA[<p>Was soll das 'int' da?</p>
<pre><code class="language-cpp">vector&lt; vector&lt;pfcOutline2D_ptr&gt; &gt; Sectionlines;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2439110</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2439110</guid><dc:creator><![CDATA[Th69]]></dc:creator><pubDate>Thu, 22 Jan 2015 18:43:32 GMT</pubDate></item><item><title><![CDATA[Reply to Zweidimensionaler Vector dynamisch erzeugen. on Thu, 22 Jan 2015 18:59:31 GMT]]></title><description><![CDATA[<p>Ich dachte das ich 2 Datentypen brauche ?</p>
<p>Sectionlines[1][i}-&gt;</p>
<p>das erste [] wird doch einfach nur durchnummeriert von der Anzahl der Gruppen, das zweite ist dann mein Datentyp &quot;pfcOutline2D_ptr&quot;.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2439116</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2439116</guid><dc:creator><![CDATA[maniche]]></dc:creator><pubDate>Thu, 22 Jan 2015 18:59:31 GMT</pubDate></item><item><title><![CDATA[Reply to Zweidimensionaler Vector dynamisch erzeugen. on Thu, 22 Jan 2015 19:11:31 GMT]]></title><description><![CDATA[<p>Der zweite ist <code>pfcOutline2D_ptr</code> , der erste ist <code>vector&lt;pfcOutline2D_ptr&gt;</code> .</p>
<p>D.h. Sectionlines[0] gibt eine Referenz auf <code>vector&lt;pfcOutline2D_ptr&gt;</code> zurück. Auf dieser wird dann wieder operator[] aufgerufen und dieser gibt dann <code>pfcOutline2D_ptr</code> zurück</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2439119</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2439119</guid><dc:creator><![CDATA[patrick246]]></dc:creator><pubDate>Thu, 22 Jan 2015 19:11:31 GMT</pubDate></item><item><title><![CDATA[Reply to Zweidimensionaler Vector dynamisch erzeugen. on Thu, 22 Jan 2015 19:44:39 GMT]]></title><description><![CDATA[<p>Habe es jetzt mit</p>
<pre><code>vector&lt; vector&lt;pfcOutline2D_ptr&gt; &gt; Sectionlines;

Sectionlines[i].push_back(wfcSectionEntityLine::cast(SectionEntities[i]-&gt;get(k))-&gt;GetLine());
</code></pre>
<p>und auch mal mit:</p>
<pre><code>vector&lt;pfcOutline2D_ptr&gt; &gt; Sectionlines[10];

Sectionlines[i].push_back(wfcSectionEntityLine::cast(SectionEntities[i]-&gt;get(k))-&gt;GetLine());
</code></pre>
<p>Zu Testzwecken versucht, bei beiden stürzt das Programm ab.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2439121</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2439121</guid><dc:creator><![CDATA[maniche]]></dc:creator><pubDate>Thu, 22 Jan 2015 19:44:39 GMT</pubDate></item><item><title><![CDATA[Reply to Zweidimensionaler Vector dynamisch erzeugen. on Thu, 22 Jan 2015 20:32:38 GMT]]></title><description><![CDATA[<p>Hallo, mit</p>
<pre><code>vector&lt; vector&lt;pfcOutline2D_ptr&gt; &gt; Sectionlines(10);

Sectionlines[i].push_back(wfcSectionEntityLine::cast(SectionEntities[i]-&gt;get(k))-&gt;GetLine());
</code></pre>
<p>hat es jetzt geklappt, dankeschön !</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2439125</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2439125</guid><dc:creator><![CDATA[maniche]]></dc:creator><pubDate>Thu, 22 Jan 2015 20:32:38 GMT</pubDate></item></channel></rss>