<?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[char[] beschneiden]]></title><description><![CDATA[<p>Hi,</p>
<p>ich habe einen <strong>unsigned char temp[99]</strong> , in dem ein Pfad wie zb <strong>%blabla\bla\blabla\juhu.exe</strong> steht.<br />
Ich möchte jetzt alles vor dem letzten \ abschneiden, so dass im char nur noch juhu.exe steht.</p>
<p>Wie kann ich das machen?</p>
<p>gruß<br />
Alex</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/215874/char-beschneiden</link><generator>RSS for Node</generator><lastBuildDate>Sun, 11 Oct 2026 21:19:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/215874.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 16 Jun 2008 14:50:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to char[] beschneiden on Mon, 16 Jun 2008 14:50:54 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich habe einen <strong>unsigned char temp[99]</strong> , in dem ein Pfad wie zb <strong>%blabla\bla\blabla\juhu.exe</strong> steht.<br />
Ich möchte jetzt alles vor dem letzten \ abschneiden, so dass im char nur noch juhu.exe steht.</p>
<p>Wie kann ich das machen?</p>
<p>gruß<br />
Alex</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1530199</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1530199</guid><dc:creator><![CDATA[filth]]></dc:creator><pubDate>Mon, 16 Jun 2008 14:50:54 GMT</pubDate></item><item><title><![CDATA[Reply to char[] beschneiden on Mon, 16 Jun 2008 15:09:38 GMT]]></title><description><![CDATA[<p>abschneiden geht nicht</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1530207</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1530207</guid><dc:creator><![CDATA[schere]]></dc:creator><pubDate>Mon, 16 Jun 2008 15:09:38 GMT</pubDate></item><item><title><![CDATA[Reply to char[] beschneiden on Mon, 16 Jun 2008 15:11:59 GMT]]></title><description><![CDATA[<p>Ohne zu testen und ohne jegliche Überprüfungen auf fehlerhaften Input (z.B. wenn nur ein Pfad übergeben wurde):</p>
<pre><code class="language-cpp">std::string extractFileName(const std::string&amp; fullPath)
{
    return fullPath.substr(fullPath.find_last_of('\\') + 1, std::string::npos);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1530209</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1530209</guid><dc:creator><![CDATA[Tachyon]]></dc:creator><pubDate>Mon, 16 Jun 2008 15:11:59 GMT</pubDate></item><item><title><![CDATA[Reply to char[] beschneiden on Mon, 16 Jun 2008 15:33:12 GMT]]></title><description><![CDATA[<p>Vielen Dank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1530217</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1530217</guid><dc:creator><![CDATA[filth]]></dc:creator><pubDate>Mon, 16 Jun 2008 15:33:12 GMT</pubDate></item><item><title><![CDATA[Reply to char[] beschneiden on Mon, 16 Jun 2008 15:43:00 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>und um der nächsten Frage schonmal vorzugreifen: An einen &quot;char const*&quot; kommt man mittels .c_str().<br />
Das braucht man z.B. für das Öffnen von Files....</p>
<p>Gruß,</p>
<p>Simon2.</p>
<p>P.S.: Aber eben &quot;const&quot; - d.h.: Verändern nur über den string selbst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1530229</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1530229</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Mon, 16 Jun 2008 15:43:00 GMT</pubDate></item><item><title><![CDATA[Reply to char[] beschneiden on Mon, 16 Jun 2008 16:17:32 GMT]]></title><description><![CDATA[<p>Und wenn man eine abneigung gegenüber C++ hat kann man auch folgendes machen:</p>
<pre><code class="language-cpp">unsigned char temp[99] = &quot;%blabla\bla\blabla\juhu.exe&quot;;
unsigned char* pos = strrchr('\\');
strcpy(temp, pos);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1530268</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1530268</guid><dc:creator><![CDATA[adapter]]></dc:creator><pubDate>Mon, 16 Jun 2008 16:17:32 GMT</pubDate></item></channel></rss>