<?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[ifstream infile(&amp;quot;test&amp;quot;) was anderes als ifstream infile(string)   ?]]></title><description><![CDATA[<p>Hallo!<br />
Habe folgendes Problem:<br />
wenn ich</p>
<pre><code>ifstream infile(&quot;test&quot;);
</code></pre>
<p>schreibe gehts. Aber wenn ich</p>
<pre><code>string test=&quot;test&quot;;
ifstream infile(test);
</code></pre>
<p>schreibe kommt</p>
<blockquote>
<p>Konvertierung des Parameters 1 von 'std::string' in 'const char *' nicht möglich</p>
</blockquote>
<p>in der Zeile von &quot;ifstream infile(test);&quot;</p>
<p>Woran kann das liegen? Christoph</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/202977/ifstream-infile-quot-test-quot-was-anderes-als-ifstream-infile-string</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Apr 2026 00:00:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/202977.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 17 Jan 2008 13:45:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ifstream infile(&amp;quot;test&amp;quot;) was anderes als ifstream infile(string)   ? on Thu, 17 Jan 2008 13:45:39 GMT]]></title><description><![CDATA[<p>Hallo!<br />
Habe folgendes Problem:<br />
wenn ich</p>
<pre><code>ifstream infile(&quot;test&quot;);
</code></pre>
<p>schreibe gehts. Aber wenn ich</p>
<pre><code>string test=&quot;test&quot;;
ifstream infile(test);
</code></pre>
<p>schreibe kommt</p>
<blockquote>
<p>Konvertierung des Parameters 1 von 'std::string' in 'const char *' nicht möglich</p>
</blockquote>
<p>in der Zeile von &quot;ifstream infile(test);&quot;</p>
<p>Woran kann das liegen? Christoph</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1438394</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1438394</guid><dc:creator><![CDATA[SchlitzInDaHaus]]></dc:creator><pubDate>Thu, 17 Jan 2008 13:45:39 GMT</pubDate></item><item><title><![CDATA[Reply to ifstream infile(&amp;quot;test&amp;quot;) was anderes als ifstream infile(string)   ? on Thu, 17 Jan 2008 13:48:19 GMT]]></title><description><![CDATA[<p>Das liegt an einer leichten Inkonsistenz der Standardbibliothek - ifstream erwartet den Dateinamen nicht als std::string, sondern als char* (String im C-Stil). Die Lösung lautet <code>ifstream infile(test.c_str());</code> .</p>
<p>PS: Im neu kommenden Ansi-Standard wird das afaik behoben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1438397</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1438397</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 17 Jan 2008 13:48:19 GMT</pubDate></item><item><title><![CDATA[Reply to ifstream infile(&amp;quot;test&amp;quot;) was anderes als ifstream infile(string)   ? on Thu, 17 Jan 2008 13:50:14 GMT]]></title><description><![CDATA[<p>Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1438400</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1438400</guid><dc:creator><![CDATA[SchlitzInDaHaus]]></dc:creator><pubDate>Thu, 17 Jan 2008 13:50:14 GMT</pubDate></item></channel></rss>