<?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[Viele Datein mit Inhalt erstellen | Die Dateinamen unterscheiden sich durch Nummern]]></title><description><![CDATA[<p>Warum geht das hier nicht:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;limits&gt;
#include &lt;string&gt;
using namespace std;

int main()
{
    string file_name;
    char temp;
    ofstream file;
    for(short l=0;l&lt;10;l++)
    {
        temp=l;
        file_name=&quot;D:/Peng&quot;+temp+&quot;.txt&quot;;
        file.open(file_name,ios::out | ios::app);
        for (short i=0;i&lt;50;i++)
        {
            for (short j=0;j&lt;8;j++)
            {
                file &lt;&lt; &quot;Peng!&quot;;
            }
            cout &lt;&lt; &quot;\n&quot;;
        }
        file.close();
    }

    return 0;
}
</code></pre>
<p>Das mit der Unterschiedung der verschiednen Nummern funktioniert noch nicht richtig....<br />
Hier sind mal die Errors:</p>
<blockquote>
<p>Compiling: C:\MinGW\Andi\oioioi.cpp<br />
C:\MinGW\Andi\oioioi.cpp: In function <code>int main()': C:\\MinGW\\Andi\\oioioi.cpp:15: error: invalid operands of types \</code>const char*' and `const char[5]' to binary <code>operator+' C:\\MinGW\\Andi\\oioioi.cpp:16: error: no matching function for call to</code>std::basic_ofstream&lt;char, std::char_traits&lt;char&gt; &gt;::open(std::string&amp;, std::_Ios_Openmode)'<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/fstream:695: note: candidates are: void std::basic_ofstream&lt;_CharT, _Traits&gt;::open(const char*, std::_Ios_Openmode) [with _CharT = char, _Traits = std::char_traits&lt;char&gt;]<br />
Process terminated with status 1 (0 minutes, 0 seconds)<br />
3 errors, 0 warnings</p>
</blockquote>
<p>MfG<br />
Stromberg</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/200557/viele-datein-mit-inhalt-erstellen-die-dateinamen-unterscheiden-sich-durch-nummern</link><generator>RSS for Node</generator><lastBuildDate>Sun, 04 Oct 2026 21:46:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/200557.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 16 Dec 2007 18:14:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Viele Datein mit Inhalt erstellen | Die Dateinamen unterscheiden sich durch Nummern on Sun, 16 Dec 2007 18:14:17 GMT]]></title><description><![CDATA[<p>Warum geht das hier nicht:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;limits&gt;
#include &lt;string&gt;
using namespace std;

int main()
{
    string file_name;
    char temp;
    ofstream file;
    for(short l=0;l&lt;10;l++)
    {
        temp=l;
        file_name=&quot;D:/Peng&quot;+temp+&quot;.txt&quot;;
        file.open(file_name,ios::out | ios::app);
        for (short i=0;i&lt;50;i++)
        {
            for (short j=0;j&lt;8;j++)
            {
                file &lt;&lt; &quot;Peng!&quot;;
            }
            cout &lt;&lt; &quot;\n&quot;;
        }
        file.close();
    }

    return 0;
}
</code></pre>
<p>Das mit der Unterschiedung der verschiednen Nummern funktioniert noch nicht richtig....<br />
Hier sind mal die Errors:</p>
<blockquote>
<p>Compiling: C:\MinGW\Andi\oioioi.cpp<br />
C:\MinGW\Andi\oioioi.cpp: In function <code>int main()': C:\\MinGW\\Andi\\oioioi.cpp:15: error: invalid operands of types \</code>const char*' and `const char[5]' to binary <code>operator+' C:\\MinGW\\Andi\\oioioi.cpp:16: error: no matching function for call to</code>std::basic_ofstream&lt;char, std::char_traits&lt;char&gt; &gt;::open(std::string&amp;, std::_Ios_Openmode)'<br />
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/fstream:695: note: candidates are: void std::basic_ofstream&lt;_CharT, _Traits&gt;::open(const char*, std::_Ios_Openmode) [with _CharT = char, _Traits = std::char_traits&lt;char&gt;]<br />
Process terminated with status 1 (0 minutes, 0 seconds)<br />
3 errors, 0 warnings</p>
</blockquote>
<p>MfG<br />
Stromberg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1421515</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1421515</guid><dc:creator><![CDATA[Stromberg]]></dc:creator><pubDate>Sun, 16 Dec 2007 18:14:17 GMT</pubDate></item><item><title><![CDATA[Reply to Viele Datein mit Inhalt erstellen | Die Dateinamen unterscheiden sich durch Nummern on Sun, 16 Dec 2007 18:18:18 GMT]]></title><description><![CDATA[<p>In den FAQs wird die Umwandlung von Strings in Zahlen und umgedreht erklärt!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1421517</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1421517</guid><dc:creator><![CDATA[*D*]]></dc:creator><pubDate>Sun, 16 Dec 2007 18:18:18 GMT</pubDate></item><item><title><![CDATA[Reply to Viele Datein mit Inhalt erstellen | Die Dateinamen unterscheiden sich durch Nummern on Sun, 16 Dec 2007 20:25:35 GMT]]></title><description><![CDATA[<p>Okay, dann hier das Beispiel aus der FAQ:</p>
<pre><code class="language-cpp">#include &lt;sstream&gt; 
#include &lt;string&gt; 
#include &lt;iostream&gt; 
using namespace std; 
int main() 
{ 
    double d = 3.14; 
    ostringstream Str; 
    Str &lt;&lt; d; 
    string ZahlAlsString(Str.str()); 
    cout &lt;&lt; ZahlAlsString &lt;&lt; endl; 
}
</code></pre>
<p>Was ist den genau &quot;ostringstream&quot; für ein Typ? Und die methode &quot;.str()&quot; wandelt doch nur einen &quot;ostringstream&quot; in einen &quot;string&quot; um oder?<br />
Wie &quot;.c_str()&quot; string in char???<br />
Und &lt;sstream&gt; is die Header Datei für den Typ ostringstream?<br />
MfG<br />
Stromberg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1421632</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1421632</guid><dc:creator><![CDATA[Stromberg]]></dc:creator><pubDate>Sun, 16 Dec 2007 20:25:35 GMT</pubDate></item><item><title><![CDATA[Reply to Viele Datein mit Inhalt erstellen | Die Dateinamen unterscheiden sich durch Nummern on Sun, 16 Dec 2007 20:55:27 GMT]]></title><description><![CDATA[<p>Noch eine Frage, wie bekomme ich den einen &quot;ostringstream&quot; wieder leer?!<br />
MfG<br />
Stromberg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1421644</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1421644</guid><dc:creator><![CDATA[Stromberg]]></dc:creator><pubDate>Sun, 16 Dec 2007 20:55:27 GMT</pubDate></item><item><title><![CDATA[Reply to Viele Datein mit Inhalt erstellen | Die Dateinamen unterscheiden sich durch Nummern on Sun, 16 Dec 2007 21:03:21 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">ostr.str(&quot;&quot;);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1421647</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1421647</guid><dc:creator><![CDATA[The-Kenny]]></dc:creator><pubDate>Sun, 16 Dec 2007 21:03:21 GMT</pubDate></item><item><title><![CDATA[Reply to Viele Datein mit Inhalt erstellen | Die Dateinamen unterscheiden sich durch Nummern on Sun, 16 Dec 2007 21:11:51 GMT]]></title><description><![CDATA[<p>google -&gt; &quot;ostringstream leeren&quot; -&gt; erster treffer sowie dritter treffer (würdest du auch über die sufu finden <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/1421651</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1421651</guid><dc:creator><![CDATA[hey]]></dc:creator><pubDate>Sun, 16 Dec 2007 21:11:51 GMT</pubDate></item></channel></rss>