<?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[Text in Array]]></title><description><![CDATA[<p>Hallo Forum,</p>
<p>Ich steke wieder mitten in einem riesen fragezeichen (?) !!!</p>
<p>Ich lade eine textdatei:</p>
<pre><code class="language-cpp">HANDLE hFile;
hFile = CreateFile(pszFileName, GENERIC_READ,
                       FILE_SHARE_READ, NULL,
                       OPEN_EXISTING, 0, NULL);
</code></pre>
<p>nun frage ich mich wie ich den text in der txt datei in einem array speichern kann??</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/205119/text-in-array</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 15:52:57 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/205119.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 10 Feb 2008 19:09:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Text in Array on Sun, 10 Feb 2008 19:09:54 GMT]]></title><description><![CDATA[<p>Hallo Forum,</p>
<p>Ich steke wieder mitten in einem riesen fragezeichen (?) !!!</p>
<p>Ich lade eine textdatei:</p>
<pre><code class="language-cpp">HANDLE hFile;
hFile = CreateFile(pszFileName, GENERIC_READ,
                       FILE_SHARE_READ, NULL,
                       OPEN_EXISTING, 0, NULL);
</code></pre>
<p>nun frage ich mich wie ich den text in der txt datei in einem array speichern kann??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453256</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453256</guid><dc:creator><![CDATA[Showball]]></dc:creator><pubDate>Sun, 10 Feb 2008 19:09:54 GMT</pubDate></item><item><title><![CDATA[Reply to Text in Array on Sun, 10 Feb 2008 19:14:02 GMT]]></title><description><![CDATA[<p>nimm doch lieber fstream.h</p>
<p>string str;</p>
<p>ifstream in;</p>
<p>in.open( ... );</p>
<p>while( !in.eof( ) )<br />
in &gt;&gt; str;</p>
<p>fertig.</p>
<p>Gruß Tobi.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453257</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453257</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sun, 10 Feb 2008 19:14:02 GMT</pubDate></item><item><title><![CDATA[Reply to Text in Array on Sun, 10 Feb 2008 19:16:03 GMT]]></title><description><![CDATA[<p>hast dir schonmal die doku dazu angesehen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /><br />
erst CreateFile gültiges Handle holen, mit ReadFile den Text und CloseHandle das Filehandle schließen, Bsp:</p>
<pre><code class="language-cpp">PUCHAR strresult = new UCHAR[50];
HANDLE hFile;

hFile = CreateFile (&quot;C:\\blabla.txt&quot;, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
ReadFile (hFile, strresult, 16, &amp;dwRead, NULL);
CloseHandle (hFile);
</code></pre>
<p>EDIT: das ist hier das WinAPI-Forum, T0bi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453261</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453261</guid><dc:creator><![CDATA[Fake oder Echt]]></dc:creator><pubDate>Sun, 10 Feb 2008 19:16:03 GMT</pubDate></item><item><title><![CDATA[Reply to Text in Array on Sun, 10 Feb 2008 19:19:36 GMT]]></title><description><![CDATA[<p>Löl wie simpel <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>und auf die einzelnen buchstaben bzw stellen kann ich nun per</p>
<p>strresult[3];</p>
<p>zugreifen.</p>
<p>das wäre dann also die dritte stelle oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453266</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453266</guid><dc:creator><![CDATA[Showball]]></dc:creator><pubDate>Sun, 10 Feb 2008 19:19:36 GMT</pubDate></item><item><title><![CDATA[Reply to Text in Array on Sun, 10 Feb 2008 19:23:50 GMT]]></title><description><![CDATA[<p>nö, dass waer die 4te stelle <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1453271</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453271</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sun, 10 Feb 2008 19:23:50 GMT</pubDate></item><item><title><![CDATA[Reply to Text in Array on Sun, 10 Feb 2008 19:31:53 GMT]]></title><description><![CDATA[<p>Achja 0 ist ja auch eine zahl^^</p>
<p>Andere frage, wenn ich in der txt datei ein</p>
<p>a</p>
<p>stehen habe, und danach tausende leerzeichen, und danach ein b, ist dann zwischen a und b ein leerzeichen oder tausende? und wie siehts bei absätzen aus?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453276</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453276</guid><dc:creator><![CDATA[Showball]]></dc:creator><pubDate>Sun, 10 Feb 2008 19:31:53 GMT</pubDate></item><item><title><![CDATA[Reply to Text in Array on Sun, 10 Feb 2008 19:44:30 GMT]]></title><description><![CDATA[<p>wird alles erkannt, leerzeichen als leerzeichen und absatz als absatz, wenn du aber das char-Element ausgibts, in dem der absatz gespeichert ist, gibt er glaube ich nur ein komisches zeichen raus...das zeichen ist aber weg wenn du das komplett ausgibts oder so xD</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453287</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453287</guid><dc:creator><![CDATA[Fake oder Echt]]></dc:creator><pubDate>Sun, 10 Feb 2008 19:44:30 GMT</pubDate></item><item><title><![CDATA[Reply to Text in Array on Mon, 11 Feb 2008 07:07:15 GMT]]></title><description><![CDATA[<p>Ja da ist jetzt auch mein problehm, ich will auf die einzelnen zeichen zugreifen können, wie mache ich das?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453431</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453431</guid><dc:creator><![CDATA[Showball]]></dc:creator><pubDate>Mon, 11 Feb 2008 07:07:15 GMT</pubDate></item><item><title><![CDATA[Reply to Text in Array on Tue, 12 Feb 2008 12:48:10 GMT]]></title><description><![CDATA[<p>Problehm gelöst!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1454340</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1454340</guid><dc:creator><![CDATA[Showball]]></dc:creator><pubDate>Tue, 12 Feb 2008 12:48:10 GMT</pubDate></item><item><title><![CDATA[Reply to Text in Array on Tue, 12 Feb 2008 13:12:12 GMT]]></title><description><![CDATA[<p>und wie haste das gemacht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1454364</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1454364</guid><dc:creator><![CDATA[Fake oder Echt]]></dc:creator><pubDate>Tue, 12 Feb 2008 13:12:12 GMT</pubDate></item><item><title><![CDATA[Reply to Text in Array on Tue, 12 Feb 2008 13:41:32 GMT]]></title><description><![CDATA[<p>^^</p>
<p>Das würde ich euch gerne zeigen, bin aber gerade inner firma ohne mein notebook ...</p>
<p>Kenne Code net auswendig ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1454396</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1454396</guid><dc:creator><![CDATA[Showball]]></dc:creator><pubDate>Tue, 12 Feb 2008 13:41:32 GMT</pubDate></item><item><title><![CDATA[Reply to Text in Array on Tue, 12 Feb 2008 13:56:16 GMT]]></title><description><![CDATA[<p>Ok, ich versuche mich mal wieder dran zu erinnern xD</p>
<p>also, die abfrage, ob das zeichen = das zeichen ist, habe ich wie folgt gemacht:</p>
<pre><code class="language-cpp">if(strresult[1] == b)
{
//mach was
}
</code></pre>
<p>natürlich muss das nach dem laden erfolgen ...<br />
Wenn ich jetzt in der txt-datei &quot;abc&quot; stehen habe, trift die bedingung zu, da 1 für die zweite stelle steht, bzw zweite zeichen.</p>
<p>Wenn ich den buchstaben nun zeichen wollte, musste ich darauf achten das ich es nicht als int also %i ausgebe, sondern als char (%c). Eine vorherige convertierung von PUCHAR zu char währe auch nicht schädlich ... (habe es zwar noch nicht ausgetestet, aber ich vermute das das komische zeichen bei absätzen dann auch verschwunden ist ...</p>
<p>Nun mal für alle leute die noch nicht mit ressourcen oder externen dateien gearbeitet haben.</p>
<p>wenn du z.b sagt ich möchte die tcxt datei in dem ordner wo meine exe ist öffnen, würde der link so aussehen:</p>
<blockquote>
<p>\textdatei.txt</p>
</blockquote>
<p>die textdatei wird auch geöffnet, aber nur wenn du die exe per hand startest, wenn du debugst und die exe automatisch gestartet wird, muss die txt datei in:</p>
<blockquote>
<p>c:\\was\auch\immer\projektordner\projektordner\textdatei.txt</p>
</blockquote>
<p>vorliegen, da (wie ich vermute) eine exe in diesem ordner erstellt wird, gestartet und anschließend verschoben in den debuggorder wird ...</p>
<p>Also, an alle leute die wie ich immer alles vergessen:</p>
<p><em><strong>MERKEN</strong></em>*<br />
xD</p>
<p>Code schicke ich nachher!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1454412</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1454412</guid><dc:creator><![CDATA[Showball]]></dc:creator><pubDate>Tue, 12 Feb 2008 13:56:16 GMT</pubDate></item></channel></rss>