<?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[rename txt Ordnerinhalt]]></title><description><![CDATA[<p>Guten Tag,<br />
ich möchte alle Textdateien in einem Verzeichniss mit ihrer FileSize und einem Zahlencount am Anfang umbenennen.<br />
FEHLERMELDUNG:<br />
16 C:\C++\FEHLER rename ordnerinhalt txt.cpp invalid operands of types `const char*' and `const char[5]' to binary `operator+'</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;windows.h&gt;
#include &lt;string&gt;
#include &lt;stdio.h&gt;

using namespace std;
int main() {
int DATARR, DATSIZ, Z=0;

WIN32_FIND_DATA FINDAT;
HANDLE SUCHEN = FindFirstFile(&quot;C:\\C++\\*.txt&quot;,&amp;FINDAT);

do {
DATSIZ = FINDAT.nFileSizeLow;
string ALTNAM = FINDAT.cFileName;
string NEUNAM = Z + &quot; - &quot; + DATSIZ + &quot;.txt&quot;;

rename(ALTNAM.c_str(), NEUNAM.c_str());

DATARR = FindNextFile(SUCHEN,&amp;FINDAT);
Z++;
}
while (DATARR);

cin.get();
return 0; }
</code></pre>
<p>Währe sehr Dankbar für eine Lösung.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/232971/rename-txt-ordnerinhalt</link><generator>RSS for Node</generator><lastBuildDate>Fri, 25 Sep 2026 03:11:39 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/232971.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 29 Jan 2009 15:59:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to rename txt Ordnerinhalt on Thu, 29 Jan 2009 15:59:34 GMT]]></title><description><![CDATA[<p>Guten Tag,<br />
ich möchte alle Textdateien in einem Verzeichniss mit ihrer FileSize und einem Zahlencount am Anfang umbenennen.<br />
FEHLERMELDUNG:<br />
16 C:\C++\FEHLER rename ordnerinhalt txt.cpp invalid operands of types `const char*' and `const char[5]' to binary `operator+'</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;windows.h&gt;
#include &lt;string&gt;
#include &lt;stdio.h&gt;

using namespace std;
int main() {
int DATARR, DATSIZ, Z=0;

WIN32_FIND_DATA FINDAT;
HANDLE SUCHEN = FindFirstFile(&quot;C:\\C++\\*.txt&quot;,&amp;FINDAT);

do {
DATSIZ = FINDAT.nFileSizeLow;
string ALTNAM = FINDAT.cFileName;
string NEUNAM = Z + &quot; - &quot; + DATSIZ + &quot;.txt&quot;;

rename(ALTNAM.c_str(), NEUNAM.c_str());

DATARR = FindNextFile(SUCHEN,&amp;FINDAT);
Z++;
}
while (DATARR);

cin.get();
return 0; }
</code></pre>
<p>Währe sehr Dankbar für eine Lösung.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1654459</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1654459</guid><dc:creator><![CDATA[Herrn Mumpitz]]></dc:creator><pubDate>Thu, 29 Jan 2009 15:59:34 GMT</pubDate></item><item><title><![CDATA[Reply to rename txt Ordnerinhalt on Thu, 29 Jan 2009 16:02:56 GMT]]></title><description><![CDATA[<p>Sorry war die falsche Fehlermeldung, die richtige ist:</p>
<p>16 C:\Dokumente und Einstellungen\psi\Desktop\C++\BACKUP\KB REN.cpp cannot convert `std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;' to `const char*' for argument `1' to `int rename(const char*, const char*)'</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1654461</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1654461</guid><dc:creator><![CDATA[Herrn Mumpitz]]></dc:creator><pubDate>Thu, 29 Jan 2009 16:02:56 GMT</pubDate></item><item><title><![CDATA[Reply to rename txt Ordnerinhalt on Thu, 29 Jan 2009 16:42:40 GMT]]></title><description><![CDATA[<p>Die gezeigte Zeile ist korrekt - du übergibst ein const char*, die Fehlermeldung sagt aber es wäre ein std::string. Da stimmt was bei dir nicht.</p>
<p>Probier mal das neu-kompilieren der ganzen Datei.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1654487</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1654487</guid><dc:creator><![CDATA[The-Kenny]]></dc:creator><pubDate>Thu, 29 Jan 2009 16:42:40 GMT</pubDate></item><item><title><![CDATA[Reply to rename txt Ordnerinhalt on Thu, 29 Jan 2009 19:19:37 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;windows.h&gt;
#include &lt;string&gt;
#include &lt;cstdio&gt; //

using namespace std;

int main()
{
   int DATARR, Z=0; //hässlich -&gt; for-schleife und die abbruchbedingung in nen break verpacken oder so...

   WIN32_FIND_DATA FINDAT;
   HANDLE SUCHEN = FindFirstFile(&quot;C:/C++/*.txt&quot;, &amp;FINDAT);

   do
   {
      int DATSIZ = FINDAT.nFileSizeLow;
      string ALTNAM = FINDAT.cFileName;
      string NEUNAM = Z + &quot; - &quot; + DATSIZ + &quot;.txt&quot;; //geht nicht... siehe FAQ - einmal zahl und zurück oder so

      rename(ALTNAM.c_str(), NEUNAM.c_str());

      DATARR = FindNextFile(SUCHEN,&amp;FINDAT);
      Z++;
   } while (DATARR);

   cin.get();
}
</code></pre>
<p>evtl solltest du mal deiner Caps-Taste eine kleine Pause gönnen - varialben-name in caps zu schreiben ist hässlich - das macht man üblicherweise nur bei makros oder globalen konstanten...<br />
deine schleife sieht auch eher so aus, als ob es ne for-schleife werden könnte ^^<br />
das return am ende ist nicht nötig<br />
einer deiner header war falsch<br />
den pfad kann man auch mit '/' angeben statt jedesmal '\' zu schreiben</p>
<p>ich hoffe, ich konnte ein wenig helfen ^^</p>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1654581</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1654581</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Thu, 29 Jan 2009 19:19:37 GMT</pubDate></item><item><title><![CDATA[Reply to rename txt Ordnerinhalt on Thu, 29 Jan 2009 22:00:05 GMT]]></title><description><![CDATA[<p>Hallo, erstmal Danke für die Hilfe.<br />
Ich hab alles etwas geändert, lässt sich Compilen aber benennt noch nicht um.</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;windows.h&gt;
#include &lt;string&gt;
#include &lt;cstdio&gt;

using namespace std;
int main(void)
{

    WIN32_FIND_DATA DATDLL;
    HANDLE SUCHEN = FindFirstFile(&quot;C:\C++\*.txt&quot;, &amp;DATDLL);

     while(FindNextFile(SUCHEN, &amp;DATDLL))
     {         

           int DATSIZ = DATDLL.nFileSizeLow;
           string ALTNAM = DATDLL.cFileName;
           string NEUNAM = DATSIZ + &quot;.txt&quot;;

           rename(ALTNAM.c_str(), NEUNAM.c_str());

     }
     cin.get();
}
</code></pre>
<p>keine Fehlermeldung nur &quot;10:31 C:\C++\Kopie.cpp [Warning] unknown escape sequence '\D'</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1654693</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1654693</guid><dc:creator><![CDATA[Herrn Mumpitz]]></dc:creator><pubDate>Thu, 29 Jan 2009 22:00:05 GMT</pubDate></item><item><title><![CDATA[Reply to rename txt Ordnerinhalt on Fri, 30 Jan 2009 00:42:35 GMT]]></title><description><![CDATA[<p>u schrieb:</p>
<blockquote>
<pre><code class="language-cpp">HANDLE SUCHEN = FindFirstFile(&quot;C:\C++\*.txt&quot;, &amp;DATDLL);
</code></pre>
</blockquote>
<p>Ich hab gesagt, dass du '/' schreiben sollst ^^</p>
<p>siehe auch:</p>
<p>me schrieb:</p>
<blockquote>
<pre><code class="language-cpp">HANDLE SUCHEN = FindFirstFile(&quot;C:/C++/*.txt&quot;, &amp;FINDAT);
</code></pre>
</blockquote>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1654737</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1654737</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Fri, 30 Jan 2009 00:42:35 GMT</pubDate></item></channel></rss>