<?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[string-Klasse Groß-&#x2F;Klein-Schreibung]]></title><description><![CDATA[<p>Mein Programm:</p>
<pre><code class="language-cpp">#include &lt;string&gt;
#include &lt;iostream&gt;
using namespace std;

int main() {
string s1 = &quot;ABCD&quot;;
string s2 = &quot;abcd&quot;;
string s3 = &quot;DCBA&quot;;
string s4 = &quot;dcba&quot;;
                           //Ausgabe
cout &lt;&lt; (s1 &lt; s2) &lt;&lt; endl; //1
cout &lt;&lt; (s1 &lt; s3) &lt;&lt; endl; //1
cout &lt;&lt; (s1 &lt; s4) &lt;&lt; endl; //1
cout &lt;&lt; (s2 &lt; s3) &lt;&lt; endl; //0 =&gt; &quot;abcd&quot; ist größer als &quot;DCBA&quot;
cout &lt;&lt; (s2 &lt; s4) &lt;&lt; endl; //1
cout &lt;&lt; (s3 &lt; s4) &lt;&lt; endl; //1

return 0;
}
</code></pre>
<p>Meinem Programm entnehme ich, dass Strings mit kleinen Buchstaben in jedem Fall größer sind als welche mit großen Zeichen. Soweit so gut.<br />
Aber was, wenn ich zum Beispiel eine Liste von Namen sortieren möchte?<br />
Dann würden doch die Namen die klein geschrieben sind (oder klein geschrieben beginnen) in jedem fall nach den großgeschriebenen kommen.<br />
Das ist ja nun wirklich nicht im Sinne des erfinders oder?</p>
<p>Wie kann ich das beheben?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/233092/string-klasse-groß-klein-schreibung</link><generator>RSS for Node</generator><lastBuildDate>Fri, 25 Sep 2026 02:44:32 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/233092.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 31 Jan 2009 14:22:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to string-Klasse Groß-&#x2F;Klein-Schreibung on Sat, 31 Jan 2009 14:22:36 GMT]]></title><description><![CDATA[<p>Mein Programm:</p>
<pre><code class="language-cpp">#include &lt;string&gt;
#include &lt;iostream&gt;
using namespace std;

int main() {
string s1 = &quot;ABCD&quot;;
string s2 = &quot;abcd&quot;;
string s3 = &quot;DCBA&quot;;
string s4 = &quot;dcba&quot;;
                           //Ausgabe
cout &lt;&lt; (s1 &lt; s2) &lt;&lt; endl; //1
cout &lt;&lt; (s1 &lt; s3) &lt;&lt; endl; //1
cout &lt;&lt; (s1 &lt; s4) &lt;&lt; endl; //1
cout &lt;&lt; (s2 &lt; s3) &lt;&lt; endl; //0 =&gt; &quot;abcd&quot; ist größer als &quot;DCBA&quot;
cout &lt;&lt; (s2 &lt; s4) &lt;&lt; endl; //1
cout &lt;&lt; (s3 &lt; s4) &lt;&lt; endl; //1

return 0;
}
</code></pre>
<p>Meinem Programm entnehme ich, dass Strings mit kleinen Buchstaben in jedem Fall größer sind als welche mit großen Zeichen. Soweit so gut.<br />
Aber was, wenn ich zum Beispiel eine Liste von Namen sortieren möchte?<br />
Dann würden doch die Namen die klein geschrieben sind (oder klein geschrieben beginnen) in jedem fall nach den großgeschriebenen kommen.<br />
Das ist ja nun wirklich nicht im Sinne des erfinders oder?</p>
<p>Wie kann ich das beheben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1655517</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1655517</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 31 Jan 2009 14:22:36 GMT</pubDate></item><item><title><![CDATA[Reply to string-Klasse Groß-&#x2F;Klein-Schreibung on Sat, 31 Jan 2009 14:24:31 GMT]]></title><description><![CDATA[<p>Prüfe ob alle Namen großgeschrieben sind und wenn nicht änder das. Kann man ohne die Buchstaben zu kennen mit hilfe der ASCII tabelle</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1655519</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1655519</guid><dc:creator><![CDATA[tabelle]]></dc:creator><pubDate>Sat, 31 Jan 2009 14:24:31 GMT</pubDate></item><item><title><![CDATA[Reply to string-Klasse Groß-&#x2F;Klein-Schreibung on Sat, 31 Jan 2009 14:25:41 GMT]]></title><description><![CDATA[<p>und was mach ich dann wenn die namen nicht alle großgeschrieben sind?<br />
einfach abbrechen und den nutzer vor eine unsirtierte liste setzen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1655520</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1655520</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 31 Jan 2009 14:25:41 GMT</pubDate></item><item><title><![CDATA[Reply to string-Klasse Groß-&#x2F;Klein-Schreibung on Sat, 31 Jan 2009 14:28:06 GMT]]></title><description><![CDATA[<p>Du kannst deine eigene Regel mitgeben, wie du sortieren möchtest.<br />
Durch einen Funktor, oder Prädikat:<br />
<a href="http://www.cplusplus.com/reference/algorithm/sort.html" rel="nofollow">http://www.cplusplus.com/reference/algorithm/sort.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1655521</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1655521</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Sat, 31 Jan 2009 14:28:06 GMT</pubDate></item><item><title><![CDATA[Reply to string-Klasse Groß-&#x2F;Klein-Schreibung on Sat, 31 Jan 2009 14:28:52 GMT]]></title><description><![CDATA[<p>daersc schrieb:</p>
<blockquote>
<p>und was mach ich dann wenn die namen nicht alle großgeschrieben sind?<br />
einfach abbrechen und den nutzer vor eine unsirtierte liste setzen?</p>
</blockquote>
<p>Überpüfe doch die Eingabe und wenn sie nicht richtig eingegeben wurde dann änder sie einfach! Einzelnen chars in ein int Umwandeln und mit der ASCII tabelle arbeiten</p>
<p><a href="http://de.wikipedia.org/wiki/ASCII" rel="nofollow">http://de.wikipedia.org/wiki/ASCII</a></p>
<p>Ich hab das schonmal so gemacht, aber vll gehts ja noch eleganter</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1655523</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1655523</guid><dc:creator><![CDATA[tabelle]]></dc:creator><pubDate>Sat, 31 Jan 2009 14:28:52 GMT</pubDate></item><item><title><![CDATA[Reply to string-Klasse Groß-&#x2F;Klein-Schreibung on Sat, 31 Jan 2009 14:29:04 GMT]]></title><description><![CDATA[<p>Einfach den Namen in Uppercase umändern?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1655524</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1655524</guid><dc:creator><![CDATA[feigling]]></dc:creator><pubDate>Sat, 31 Jan 2009 14:29:04 GMT</pubDate></item><item><title><![CDATA[Reply to string-Klasse Groß-&#x2F;Klein-Schreibung on Sat, 31 Jan 2009 14:30:31 GMT]]></title><description><![CDATA[<p><a href="http://fara.cs.uni-potsdam.de/~kaufmann/?page=GenCppFaqs&amp;faq=stricmp#Answ" rel="nofollow">http://fara.cs.uni-potsdam.de/~kaufmann/?page=GenCppFaqs&amp;faq=stricmp#Answ</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1655526</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1655526</guid><dc:creator><![CDATA[Shade Of Mine]]></dc:creator><pubDate>Sat, 31 Jan 2009 14:30:31 GMT</pubDate></item><item><title><![CDATA[Reply to string-Klasse Groß-&#x2F;Klein-Schreibung on Sat, 31 Jan 2009 14:31:55 GMT]]></title><description><![CDATA[<p>ich möchte nicht unbedingt großschreibung erzwingen... die namen sollten schon so bleiben...</p>
<p>das mit den selbstdefinierten regeln bei std::sort() hilft mir glaub ich am meisten, danke <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/1655527</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1655527</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 31 Jan 2009 14:31:55 GMT</pubDate></item></channel></rss>