<?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 Problem]]></title><description><![CDATA[<p>Guten Tag zusammen<br />
Ich hab ein kleines Problem. Ich brauche einen globalen Vector den ich dann in einem Thread die Größe per .resize zuweiße und ihn dann auch gleich fülle.<br />
Klingt alles ganz simpel. Doch mein Programm hängt beim .resize eine weile und der Arbeitsspeicher-Verbrauch meines Programmes geht über 1 gig...<br />
Ich hoffe ihr könnt mir helfen.</p>
<pre><code class="language-cpp">std::vector &lt;std::vector &lt;std::wstring&gt; &gt;  multi_vec;
DWORD WINAPI Thread_no_1( LPVOID lpParam ) 
{
FILE * datei1;
char zeile1 [200];
datei1 = fopen(&quot;Autos.csv&quot;, &quot;rt&quot;);
int zeilen_anzahl = 0;
if (datei1 != NULL) {
	while(fgets(zeile1, sizeof(zeile1), datei1) != NULL) 
		{
			zeilen_anzahl++;
		}
	}
	fclose(datei1);
multi_vec.resize(zeilen_anzahl);//ungefähr 2000
multi_vec[5][5] = L&quot;Hallo&quot;;
...
return 0;
}
</code></pre>
<p>Edit: Wenn ich den Vektor auch im Thread erstelle tut alles...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/244068/vector-problem</link><generator>RSS for Node</generator><lastBuildDate>Sat, 19 Sep 2026 13:53:38 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/244068.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 24 Jun 2009 16:23:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Vector Problem on Wed, 24 Jun 2009 16:55:59 GMT]]></title><description><![CDATA[<p>Guten Tag zusammen<br />
Ich hab ein kleines Problem. Ich brauche einen globalen Vector den ich dann in einem Thread die Größe per .resize zuweiße und ihn dann auch gleich fülle.<br />
Klingt alles ganz simpel. Doch mein Programm hängt beim .resize eine weile und der Arbeitsspeicher-Verbrauch meines Programmes geht über 1 gig...<br />
Ich hoffe ihr könnt mir helfen.</p>
<pre><code class="language-cpp">std::vector &lt;std::vector &lt;std::wstring&gt; &gt;  multi_vec;
DWORD WINAPI Thread_no_1( LPVOID lpParam ) 
{
FILE * datei1;
char zeile1 [200];
datei1 = fopen(&quot;Autos.csv&quot;, &quot;rt&quot;);
int zeilen_anzahl = 0;
if (datei1 != NULL) {
	while(fgets(zeile1, sizeof(zeile1), datei1) != NULL) 
		{
			zeilen_anzahl++;
		}
	}
	fclose(datei1);
multi_vec.resize(zeilen_anzahl);//ungefähr 2000
multi_vec[5][5] = L&quot;Hallo&quot;;
...
return 0;
}
</code></pre>
<p>Edit: Wenn ich den Vektor auch im Thread erstelle tut alles...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1732250</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1732250</guid><dc:creator><![CDATA[Fatal Error appears]]></dc:creator><pubDate>Wed, 24 Jun 2009 16:55:59 GMT</pubDate></item><item><title><![CDATA[Reply to Vector Problem on Wed, 24 Jun 2009 16:33:16 GMT]]></title><description><![CDATA[<p>c + winapi. nüx c++</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1732255</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1732255</guid><dc:creator><![CDATA[kompajler]]></dc:creator><pubDate>Wed, 24 Jun 2009 16:33:16 GMT</pubDate></item><item><title><![CDATA[Reply to Vector Problem on Wed, 24 Jun 2009 16:54:43 GMT]]></title><description><![CDATA[<p>Wenn es am Thread liegt schon? Aber ich dachte es liegt am Vector...<br />
Naja wenn ein Admin verbeischaut kann er es ja bitte verschieben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1732268</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1732268</guid><dc:creator><![CDATA[Fatal Error appears]]></dc:creator><pubDate>Wed, 24 Jun 2009 16:54:43 GMT</pubDate></item><item><title><![CDATA[Reply to Vector Problem on Thu, 25 Jun 2009 07:19:46 GMT]]></title><description><![CDATA[<p>Hier gehts weiter:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-244074.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-244074.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1732499</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1732499</guid><dc:creator><![CDATA[theta]]></dc:creator><pubDate>Thu, 25 Jun 2009 07:19:46 GMT</pubDate></item></channel></rss>