<?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[str.find problem]]></title><description><![CDATA[<p>hallo</p>
<p>ich hab in einer schleife folgendes stehen</p>
<pre><code class="language-cpp">std::string tempstr;
tempstr=Text[ii];
std::cout &lt;&lt; tempstr;   //funktioniert
std::cout &lt;&lt; Text[ii];  //funktioniert      
std::cout &lt;&lt; tempstr.find(&quot;#&quot;); //funktioniert nicht
</code></pre>
<p>ich verstehe nicht warum ich nicht den inhalt von Text[ii] nach &quot;#&quot; durchsuchen kann? das ergebniss ist immer eine gigantische Zahl z.B.4294967295</p>
<p>hoffe jmd kann mir helfen.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/306870/str-find-problem</link><generator>RSS for Node</generator><lastBuildDate>Fri, 07 Aug 2026 07:49:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/306870.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 09 Aug 2012 14:42:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to str.find problem on Thu, 09 Aug 2012 14:42:34 GMT]]></title><description><![CDATA[<p>hallo</p>
<p>ich hab in einer schleife folgendes stehen</p>
<pre><code class="language-cpp">std::string tempstr;
tempstr=Text[ii];
std::cout &lt;&lt; tempstr;   //funktioniert
std::cout &lt;&lt; Text[ii];  //funktioniert      
std::cout &lt;&lt; tempstr.find(&quot;#&quot;); //funktioniert nicht
</code></pre>
<p>ich verstehe nicht warum ich nicht den inhalt von Text[ii] nach &quot;#&quot; durchsuchen kann? das ergebniss ist immer eine gigantische Zahl z.B.4294967295</p>
<p>hoffe jmd kann mir helfen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2240422</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2240422</guid><dc:creator><![CDATA[c_anfänger]]></dc:creator><pubDate>Thu, 09 Aug 2012 14:42:34 GMT</pubDate></item><item><title><![CDATA[Reply to str.find problem on Thu, 09 Aug 2012 14:43:56 GMT]]></title><description><![CDATA[<p>Du vergleichst nicht mit std::string::npos, welches definiert ist als std::string:size_type(-1), das ist deine Zahl.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2240423</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2240423</guid><dc:creator><![CDATA[Kellerautomat]]></dc:creator><pubDate>Thu, 09 Aug 2012 14:43:56 GMT</pubDate></item><item><title><![CDATA[Reply to str.find problem on Thu, 09 Aug 2012 14:47:27 GMT]]></title><description><![CDATA[<p>Was erwartest du denn, was find zurückgibt? Du bekommst entweder die Position des Suchstrings oder npos.</p>
<p><a href="http://www.cplusplus.com/reference/string/string/find/" rel="nofollow">http://www.cplusplus.com/reference/string/string/find/</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2240425</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2240425</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Thu, 09 Aug 2012 14:47:27 GMT</pubDate></item><item><title><![CDATA[Reply to str.find problem on Thu, 09 Aug 2012 14:54:26 GMT]]></title><description><![CDATA[<p>Schau mal bitte in die Links in meiner Signatur, vor allem im ersten Link den Punkt zum Thema &quot;funktioniert nicht&quot;.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2240426</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2240426</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Thu, 09 Aug 2012 14:54:26 GMT</pubDate></item><item><title><![CDATA[Reply to str.find problem on Thu, 09 Aug 2012 15:08:48 GMT]]></title><description><![CDATA[<p>Danke</p>
<p>war mein fehler ich dachte es kommt -1 zurück und nicht npos.</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/4921">@mod</a><br />
1. habe ich die Frage präzise gestellt die antworten sind beide genau das was ich gesucht habe<br />
2.manchmal steht man nun mal auf dem schlauch und was sollte ich noch mehr schreiben als es kommt eine gigantische zahl zurück und am meinem namen könnte man erkennen das ich c/c++ nicht so oft verwende deswegen ist es für mich sehr ungewöhnlich wenn eine zahl zurückkommt statt nen Fehler oder -1!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2240434</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2240434</guid><dc:creator><![CDATA[c_anfänger]]></dc:creator><pubDate>Thu, 09 Aug 2012 15:08:48 GMT</pubDate></item><item><title><![CDATA[Reply to str.find problem on Thu, 09 Aug 2012 15:21:53 GMT]]></title><description><![CDATA[<p>c_anfänger schrieb:</p>
<blockquote>
<p>1. habe ich die Frage präzise gestellt</p>
</blockquote>
<p>Ansichtssache. <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/2240439</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2240439</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Thu, 09 Aug 2012 15:21:53 GMT</pubDate></item><item><title><![CDATA[Reply to str.find problem on Thu, 09 Aug 2012 15:26:42 GMT]]></title><description><![CDATA[<p>c_anfänger schrieb:</p>
<blockquote>
<p>1. habe ich die Frage präzise gestellt die antworten sind beide genau das was ich gesucht habe</p>
</blockquote>
<p>Nein hast du nicht, du hast bei den Codezeilen Begriffe wie &quot;funktioniert/funktioniert nicht&quot; verwendet, die Zeilen funktionieren aber allesamt, kein Compiler wird dir hier einen Fehler liefern. Auch wenn deine weitere Beschreibung den &quot;Fehler&quot; beschreibt solltest du es Lesern einfach machen und solch schwammige Begriffe nicht verwenden (Hier wäre eher ein Text wie &quot;Liefert 4294967295 statt -1&quot; hilfreich gewesen). Denk dran das man von oben nach unten liest, und &quot;funktioniert nicht&quot; hier einfach nicht greift.</p>
<p>Auch der Titel deines Threads ist nicht unbedingt glücklich gewählt, &quot;Problem&quot;/&quot;Hilfe&quot;... geben kein Eindruck auf die wirkliche Problemstellung. Etwas wie &quot;str.find liefert unerwartetes Ergebnis&quot; wäre von der Aussagekraft wesentlich höher.</p>
<p>c_anfänger schrieb:</p>
<blockquote>
<p>manchmal steht man nun mal auf dem schlauch und was sollte ich noch mehr schreiben als es kommt eine gigantische zahl zurück und am meinem namen könnte man erkennen das ich c/c++ nicht so oft verwende deswegen ist es für mich sehr ungewöhnlich wenn eine zahl zurückkommt statt nen Fehler oder -1!</p>
</blockquote>
<p>Wie gesagt, zumindest einmal in die Hilfe zu der Methode schauen ist dennoch nicht verkehrt. Wenn das das dort stehende nicht hilft, so kann man immer noch fragen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2240445</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2240445</guid><dc:creator><![CDATA[asc]]></dc:creator><pubDate>Thu, 09 Aug 2012 15:26:42 GMT</pubDate></item></channel></rss>