<?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[Problemchen mit getline]]></title><description><![CDATA[<p>Tag,</p>
<p>warum wirft mit folgender Code:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;conio.h&gt;
#include &lt;vector&gt;
#include &lt;algorithm&gt;
#include &lt;sstream&gt;
#include &lt;fstream&gt;

using namespace std;

int main () 
{
	char name[256], title[256];
	string zeile;	// to read the lines from the data file

	ofstream myfile;
	myfile.open(&quot;C:/example_grid.txt&quot;);

	while(myfile)
	{
        getline(myfile,zeile);
	}

	return 0;
}
</code></pre>
<p>diese Fehlermeldungen aus:</p>
<blockquote>
<p>error C2780: 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;std::getline(std::basic_istream&lt;_Elem,_Traits&gt; &amp;,std::basic_string&lt;_Elem,_Traits,_Alloc&gt; &amp;,const _Elem)' : expects 3 arguments - 2 provided<br />
error C2784: 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;std::getline(std::basic_istream&lt;_Elem,_Traits&gt; &amp;,std::basic_string&lt;_Elem,_Traits,_Alloc&gt; &amp;)' : could not deduce template argument for 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;' from 'std::ofstream'<br />
error C2784: 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;std::getline(std::basic_istream&lt;_Elem,_Traits&gt; &amp;,std::basic_string&lt;_Elem,_Traits,_Alloc&gt; &amp;)' : could not deduce template argument for 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;' from 'std::ofstream'<br />
error C2784: 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;std::getline(std::basic_istream&lt;_Elem,_Traits&gt; &amp;,std::basic_string&lt;_Elem,_Traits,_Alloc&gt; &amp;)' : could not deduce template argument for 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;' from 'std::ofstream'<br />
error C2784: 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;std::getline(std::basic_istream&lt;_Elem,_Traits&gt; &amp;,std::basic_string&lt;_Elem,_Traits,_Alloc&gt; &amp;)' : could not deduce template argument for 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;' from 'std::ofstream'<br />
error C2784: 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;std::getline(std::basic_istream&lt;_Elem,_Traits&gt; &amp;,std::basic_string&lt;_Elem,_Traits,_Alloc&gt; &amp;)' : could not deduce template argument for 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;' from 'std::ofstream'</p>
</blockquote>
<p>Danke.<br />
H.W.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/165459/problemchen-mit-getline</link><generator>RSS for Node</generator><lastBuildDate>Mon, 14 Sep 2026 17:20:02 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/165459.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 20 Nov 2006 08:25:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problemchen mit getline on Mon, 20 Nov 2006 08:25:34 GMT]]></title><description><![CDATA[<p>Tag,</p>
<p>warum wirft mit folgender Code:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;conio.h&gt;
#include &lt;vector&gt;
#include &lt;algorithm&gt;
#include &lt;sstream&gt;
#include &lt;fstream&gt;

using namespace std;

int main () 
{
	char name[256], title[256];
	string zeile;	// to read the lines from the data file

	ofstream myfile;
	myfile.open(&quot;C:/example_grid.txt&quot;);

	while(myfile)
	{
        getline(myfile,zeile);
	}

	return 0;
}
</code></pre>
<p>diese Fehlermeldungen aus:</p>
<blockquote>
<p>error C2780: 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;std::getline(std::basic_istream&lt;_Elem,_Traits&gt; &amp;,std::basic_string&lt;_Elem,_Traits,_Alloc&gt; &amp;,const _Elem)' : expects 3 arguments - 2 provided<br />
error C2784: 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;std::getline(std::basic_istream&lt;_Elem,_Traits&gt; &amp;,std::basic_string&lt;_Elem,_Traits,_Alloc&gt; &amp;)' : could not deduce template argument for 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;' from 'std::ofstream'<br />
error C2784: 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;std::getline(std::basic_istream&lt;_Elem,_Traits&gt; &amp;,std::basic_string&lt;_Elem,_Traits,_Alloc&gt; &amp;)' : could not deduce template argument for 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;' from 'std::ofstream'<br />
error C2784: 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;std::getline(std::basic_istream&lt;_Elem,_Traits&gt; &amp;,std::basic_string&lt;_Elem,_Traits,_Alloc&gt; &amp;)' : could not deduce template argument for 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;' from 'std::ofstream'<br />
error C2784: 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;std::getline(std::basic_istream&lt;_Elem,_Traits&gt; &amp;,std::basic_string&lt;_Elem,_Traits,_Alloc&gt; &amp;)' : could not deduce template argument for 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;' from 'std::ofstream'<br />
error C2784: 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;std::getline(std::basic_istream&lt;_Elem,_Traits&gt; &amp;,std::basic_string&lt;_Elem,_Traits,_Alloc&gt; &amp;)' : could not deduce template argument for 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;' from 'std::ofstream'</p>
</blockquote>
<p>Danke.<br />
H.W.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1177587</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1177587</guid><dc:creator><![CDATA[Hans Wurst]]></dc:creator><pubDate>Mon, 20 Nov 2006 08:25:34 GMT</pubDate></item><item><title><![CDATA[Reply to Problemchen mit getline on Mon, 20 Nov 2006 08:26:19 GMT]]></title><description><![CDATA[<p>&lt;string&gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1177588</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1177588</guid><dc:creator><![CDATA[include]]></dc:creator><pubDate>Mon, 20 Nov 2006 08:26:19 GMT</pubDate></item><item><title><![CDATA[Reply to Problemchen mit getline on Mon, 20 Nov 2006 08:28:50 GMT]]></title><description><![CDATA[<p>Dann klappts aber leider immer noch nicht. Trotzdem Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1177591</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1177591</guid><dc:creator><![CDATA[Hans Wurst]]></dc:creator><pubDate>Mon, 20 Nov 2006 08:28:50 GMT</pubDate></item><item><title><![CDATA[Reply to Problemchen mit getline on Mon, 20 Nov 2006 09:01:37 GMT]]></title><description><![CDATA[<p>ofstream =&gt; <strong>output</strong> filestream</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1177610</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1177610</guid><dc:creator><![CDATA[hinweis]]></dc:creator><pubDate>Mon, 20 Nov 2006 09:01:37 GMT</pubDate></item><item><title><![CDATA[Reply to Problemchen mit getline on Tue, 21 Nov 2006 07:44:28 GMT]]></title><description><![CDATA[<p>Oder auf Deutsch: Ein <strong>o</strong>fstream dient zur Ausgabe von Daten (<strong>O</strong>utput), du benötigst einen <strong>i</strong>fstream (Input = Eingabe)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1178172</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1178172</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 21 Nov 2006 07:44:28 GMT</pubDate></item></channel></rss>