<?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[Mein seltsamer String]]></title><description><![CDATA[<p>Hallo liebe Leser:</p>
<p>ich ahbe grade ein etwas seltsames Problem, dass ich absolut nicht verstehe, wäre also schön, wenn jemand mich da mal auf die richtige Spur bringen könnte.</p>
<p>Ich versuche eigentlich die WIN_API zum öffnen einer Datei zu bekommen, aber schon beim basteln des benötigten wstrings taucht ein Fehler auf:</p>
<p>string path1, path2;<br />
wstring path1s, path1w, path2s path2w;</p>
<pre><code class="language-cpp">path1 = &quot;C:\\\\test\\langerUnterordnername\Ordner1\\*&quot;;
path2 = &quot;C:\\\\test\\langerUnterordnername\Ordner2\\*&quot;;

path1w = s2ws(path1);
path2w = s2ws(path2);

path1s = path1w.substr (0, path1w.size()-1); 
path2s = path2w.substr (0, path2w.size()-1);
</code></pre>
<p>Wenn ich nun path1s anscheu, ist alles gut, es kommt: &quot;C:\\test\langerUnterordnername\Ordner1\&quot; raus, was ich auch haben wollte.</p>
<p>path2s ist aber komischerweise auf einmal &quot;C:\\test\langerU&quot; und das war es dann, obwohl ich ja beide strings gleich behandele.</p>
<p>Hat vielleicht jemand ne Idee dazu?</p>
<p>Edit: Tippfehler!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/303453/mein-seltsamer-string</link><generator>RSS for Node</generator><lastBuildDate>Mon, 10 Aug 2026 11:48:53 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/303453.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 14 May 2012 10:31:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Mein seltsamer String on Mon, 14 May 2012 10:39:39 GMT]]></title><description><![CDATA[<p>Hallo liebe Leser:</p>
<p>ich ahbe grade ein etwas seltsames Problem, dass ich absolut nicht verstehe, wäre also schön, wenn jemand mich da mal auf die richtige Spur bringen könnte.</p>
<p>Ich versuche eigentlich die WIN_API zum öffnen einer Datei zu bekommen, aber schon beim basteln des benötigten wstrings taucht ein Fehler auf:</p>
<p>string path1, path2;<br />
wstring path1s, path1w, path2s path2w;</p>
<pre><code class="language-cpp">path1 = &quot;C:\\\\test\\langerUnterordnername\Ordner1\\*&quot;;
path2 = &quot;C:\\\\test\\langerUnterordnername\Ordner2\\*&quot;;

path1w = s2ws(path1);
path2w = s2ws(path2);

path1s = path1w.substr (0, path1w.size()-1); 
path2s = path2w.substr (0, path2w.size()-1);
</code></pre>
<p>Wenn ich nun path1s anscheu, ist alles gut, es kommt: &quot;C:\\test\langerUnterordnername\Ordner1\&quot; raus, was ich auch haben wollte.</p>
<p>path2s ist aber komischerweise auf einmal &quot;C:\\test\langerU&quot; und das war es dann, obwohl ich ja beide strings gleich behandele.</p>
<p>Hat vielleicht jemand ne Idee dazu?</p>
<p>Edit: Tippfehler!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2211312</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2211312</guid><dc:creator><![CDATA[Lylantiel]]></dc:creator><pubDate>Mon, 14 May 2012 10:39:39 GMT</pubDate></item><item><title><![CDATA[Reply to Mein seltsamer String on Mon, 14 May 2012 10:39:00 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">path2s = path1w.substr
</code></pre>
<p>2s und 1w - ist das so gewollt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2211317</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2211317</guid><dc:creator><![CDATA[pieps]]></dc:creator><pubDate>Mon, 14 May 2012 10:39:00 GMT</pubDate></item><item><title><![CDATA[Reply to Mein seltsamer String on Mon, 14 May 2012 10:41:07 GMT]]></title><description><![CDATA[<p>Nein, war nicht so gewollt, war n Tippfehler!</p>
<p>Habs grade auch selbst gemerkt :p , aber danke.</p>
<p>Nun steht es richtig da, aber der Fehler kommt so oder so</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2211321</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2211321</guid><dc:creator><![CDATA[Lylantiel]]></dc:creator><pubDate>Mon, 14 May 2012 10:41:07 GMT</pubDate></item><item><title><![CDATA[Reply to Mein seltsamer String on Mon, 14 May 2012 10:51:58 GMT]]></title><description><![CDATA[<p>Also ich hab das ganze jetzt bestimmt 100 mal versucht ohne Erfolg, aber seit dem 151. Mal scheint es zu funktionieren.</p>
<p>Ich versteh die Welt nicht mehr <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
<p>erstmal gelöst, sollte es auf einmal wieder nicht gehen, werd ich mich melden, wäre aber dennoch froh, falls nocht wer ne Idee dazu hat, warum es am Anfang so garnicht wollte und vor allem, warum es nur bei dem einen string nicht wollte.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2211327</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2211327</guid><dc:creator><![CDATA[Lylantiel]]></dc:creator><pubDate>Mon, 14 May 2012 10:51:58 GMT</pubDate></item><item><title><![CDATA[Reply to Mein seltsamer String on Mon, 14 May 2012 10:59:55 GMT]]></title><description><![CDATA[<p>Lylantiel schrieb:</p>
<blockquote>
<p>Nein, war nicht so gewollt, war n Tippfehler!</p>
</blockquote>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f4a1.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--light_bulb"
      title=":bulb:"
      alt="💡"
    /> Deshalb nie abtippen, sondern copy-pasten! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f4a1.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--light_bulb"
      title=":bulb:"
      alt="💡"
    /></p>
<p>Erspart den Helfern unnötige Arbeit. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2211335</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2211335</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Mon, 14 May 2012 10:59:55 GMT</pubDate></item></channel></rss>