<?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[filestream zeile für zeile]]></title><description><![CDATA[<p>hi,<br />
ich habe folgendes problem...</p>
<p>ich habe eine datei in der hex werte drin stehen (source1: 34 2A 5C 73 B6 ....)<br />
dafür habe ich die datei in einem stream geöffnet und der string wird dann in ein byte-array convertiert</p>
<pre><code>ifstream file;
file.open(&quot;datei.txt&quot;);
unsigned char dataArray [256];
int counter = 0;
while(!file.eof())
{
  string tmp;
  file &gt;&gt; tmp;
  dataArray[counter++] = (strToHex(tmp[0]) &lt;&lt; 4) | strToHex(tmp[1];
}
</code></pre>
<p>aber ich muss nicht alles in das Array schieben, sondern nur manche zeilen (z.b. nur source2) und wenn nicht, dann kann ich gleich in die nächste zeile springen.<br />
wenn ich getline() verwende, dann habe ich aber ein string (momentane lösung) was ich net will, da ich mit dem stream arbeiten möchte.<br />
kann ich irgendwie in dem stream das zeilenende abfragen?<br />
habe auch schon mit getline einen string geholt und mit istrstream wieder in einen stream verwandelt .... ist ja aber auch doof.</p>
<p>weis jemand einen rat?</p>
<p>danke schonmal<br />
gruß pitrie</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/167110/filestream-zeile-für-zeile</link><generator>RSS for Node</generator><lastBuildDate>Tue, 15 Sep 2026 18:15:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/167110.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 06 Dec 2006 16:17:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to filestream zeile für zeile on Wed, 06 Dec 2006 16:17:48 GMT]]></title><description><![CDATA[<p>hi,<br />
ich habe folgendes problem...</p>
<p>ich habe eine datei in der hex werte drin stehen (source1: 34 2A 5C 73 B6 ....)<br />
dafür habe ich die datei in einem stream geöffnet und der string wird dann in ein byte-array convertiert</p>
<pre><code>ifstream file;
file.open(&quot;datei.txt&quot;);
unsigned char dataArray [256];
int counter = 0;
while(!file.eof())
{
  string tmp;
  file &gt;&gt; tmp;
  dataArray[counter++] = (strToHex(tmp[0]) &lt;&lt; 4) | strToHex(tmp[1];
}
</code></pre>
<p>aber ich muss nicht alles in das Array schieben, sondern nur manche zeilen (z.b. nur source2) und wenn nicht, dann kann ich gleich in die nächste zeile springen.<br />
wenn ich getline() verwende, dann habe ich aber ein string (momentane lösung) was ich net will, da ich mit dem stream arbeiten möchte.<br />
kann ich irgendwie in dem stream das zeilenende abfragen?<br />
habe auch schon mit getline einen string geholt und mit istrstream wieder in einen stream verwandelt .... ist ja aber auch doof.</p>
<p>weis jemand einen rat?</p>
<p>danke schonmal<br />
gruß pitrie</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1188033</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1188033</guid><dc:creator><![CDATA[pitrie]]></dc:creator><pubDate>Wed, 06 Dec 2006 16:17:48 GMT</pubDate></item><item><title><![CDATA[Reply to filestream zeile für zeile on Thu, 07 Dec 2006 10:29:55 GMT]]></title><description><![CDATA[<p>Das Zeilenende ist ein ganz normales Zeichen in deiner Datei, auch bekannt als '\n'. (außerdem könntest du den per getline() eingelesenen String auch von Hand zerlegen, wenn dir der Umweg über stringstreams zu aufwendig erscheint)</p>
<p>PS: Da du sowieso den Zeilenanfang einlesen mußt, um zu erkennen, ob du die aktuelle Zeile &quot;brauchst&quot;, schau dich mal nach ignore() um.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1188257</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1188257</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 07 Dec 2006 10:29:55 GMT</pubDate></item><item><title><![CDATA[Reply to filestream zeile für zeile on Thu, 07 Dec 2006 10:30:13 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=18038" rel="nofollow">CStoll</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=1" rel="nofollow">MFC (Visual C++)</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1188258</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1188258</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Thu, 07 Dec 2006 10:30:13 GMT</pubDate></item></channel></rss>