<?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[(C++) C++ und der Befehl getline()]]></title><description><![CDATA[<p>Hallo,</p>
<p>also ich versuche aus einer *.txt Datei einen Zeile nach Wahl auszulesen.<br />
Bekomme es aber nicht hin!<br />
Hier mal mein Quellcode:<br />
#include &lt;iostream.h&gt;<br />
#include &lt;stdlib.h&gt;<br />
#include &lt;fstream.h &gt;<br />
#include &lt;time.h&gt;</p>
<p>void main()</p>
<p>{<br />
char abbruch;</p>
<p>do<br />
{<br />
char prae[100];<br />
char subj[100];<br />
char obj[100];</p>
<p>int zufall;</p>
<p>srand((unsigned)time(NULL));<br />
zufall=1+(rand()%10);<br />
ifstream fin(&quot;Objekt.txt&quot;);</p>
<p>fin.getline(subj,100),zufall;</p>
<p>cout&lt;&lt;subj;<br />
cout&lt;&lt;endl&lt;&lt;endl&lt;&lt;&quot;Noch einen ??&quot;&lt;&lt;endl&lt;&lt;endl;<br />
cin&gt;&gt;abbruch;<br />
}<br />
while(abbruch!='n');</p>
<p>}</p>
<p>Kann mir jemand vielleicht helfen ??</p>
<p>Thomas</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/5714/c-c-und-der-befehl-getline</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 11:54:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/5714.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 08 May 2003 08:26:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to (C++) C++ und der Befehl getline() on Thu, 08 May 2003 08:26:00 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>also ich versuche aus einer *.txt Datei einen Zeile nach Wahl auszulesen.<br />
Bekomme es aber nicht hin!<br />
Hier mal mein Quellcode:<br />
#include &lt;iostream.h&gt;<br />
#include &lt;stdlib.h&gt;<br />
#include &lt;fstream.h &gt;<br />
#include &lt;time.h&gt;</p>
<p>void main()</p>
<p>{<br />
char abbruch;</p>
<p>do<br />
{<br />
char prae[100];<br />
char subj[100];<br />
char obj[100];</p>
<p>int zufall;</p>
<p>srand((unsigned)time(NULL));<br />
zufall=1+(rand()%10);<br />
ifstream fin(&quot;Objekt.txt&quot;);</p>
<p>fin.getline(subj,100),zufall;</p>
<p>cout&lt;&lt;subj;<br />
cout&lt;&lt;endl&lt;&lt;endl&lt;&lt;&quot;Noch einen ??&quot;&lt;&lt;endl&lt;&lt;endl;<br />
cin&gt;&gt;abbruch;<br />
}<br />
while(abbruch!='n');</p>
<p>}</p>
<p>Kann mir jemand vielleicht helfen ??</p>
<p>Thomas</p>
]]></description><link>https://www.c-plusplus.net/forum/post/27804</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/27804</guid><dc:creator><![CDATA[Thomas]]></dc:creator><pubDate>Thu, 08 May 2003 08:26:00 GMT</pubDate></item><item><title><![CDATA[Reply to (C++) C++ und der Befehl getline() on Thu, 08 May 2003 09:20:00 GMT]]></title><description><![CDATA[<blockquote>
<p>fin.getline(subj,100),zufall;</p>
</blockquote>
<p>Was versuchst Du denn hier ?!</p>
<p>Beispiel für das auslesen von Zeilen:</p>
<pre><code class="language-cpp">fstream file(&quot;c:\\test.txt&quot;);
std::string temp;

while(!file.eof())
{
   getline(file,temp); // Holt eine komplette Zeile
   cout&lt;&lt;temp;
}
</code></pre>
<p>[ Dieser Beitrag wurde am 08.05.2003 um 11:23 Uhr von <strong>Knuddlbaer</strong> editiert. ]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/27805</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/27805</guid><dc:creator><![CDATA[Knuddlbaer]]></dc:creator><pubDate>Thu, 08 May 2003 09:20:00 GMT</pubDate></item><item><title><![CDATA[Reply to (C++) C++ und der Befehl getline() on Thu, 08 May 2003 16:10:00 GMT]]></title><description><![CDATA[<p>Kein MFC, verschoben nach C++.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/27806</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/27806</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Thu, 08 May 2003 16:10:00 GMT</pubDate></item></channel></rss>