<?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[toupper funktion]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte einen &quot;Array of Characters&quot; der in Kleinbuchstaben eingegeben wurde, in Großbuchstaben umwandeln und das ergebnis in einer Variablen speichern. Dazu gibts die Methode &quot;toupper&quot;. Der wandelt mir aber nur einzelne zeichen um. Wie sag ich dem das der auch strings umwandeln soll?</p>
<p>folgendes beispiel (Auszug) funzt nämlich nicht.</p>
<pre><code class="language-cpp">char rom[20];
int laenge;
char zeichen;
int summe=0;
string erg;        

cout&lt;&lt;&quot;Bitte roemische Zahl eingeben: &quot;;
cin &gt;&gt; rom;
laenge = strlen(rom);
erg =toupper(rom);
</code></pre>
<p>Ich erhalte immer die Fehlermeldung: error C2664: 'toupper': Konvertierung des Parameters 1 von 'char [20]' in 'int' nicht möglich</p>
<p>Wieso int??</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/147592/toupper-funktion</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Sep 2026 14:09:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/147592.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 18 May 2006 12:43:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to toupper funktion on Thu, 18 May 2006 12:43:32 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte einen &quot;Array of Characters&quot; der in Kleinbuchstaben eingegeben wurde, in Großbuchstaben umwandeln und das ergebnis in einer Variablen speichern. Dazu gibts die Methode &quot;toupper&quot;. Der wandelt mir aber nur einzelne zeichen um. Wie sag ich dem das der auch strings umwandeln soll?</p>
<p>folgendes beispiel (Auszug) funzt nämlich nicht.</p>
<pre><code class="language-cpp">char rom[20];
int laenge;
char zeichen;
int summe=0;
string erg;        

cout&lt;&lt;&quot;Bitte roemische Zahl eingeben: &quot;;
cin &gt;&gt; rom;
laenge = strlen(rom);
erg =toupper(rom);
</code></pre>
<p>Ich erhalte immer die Fehlermeldung: error C2664: 'toupper': Konvertierung des Parameters 1 von 'char [20]' in 'int' nicht möglich</p>
<p>Wieso int??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1060114</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1060114</guid><dc:creator><![CDATA[chris090980]]></dc:creator><pubDate>Thu, 18 May 2006 12:43:32 GMT</pubDate></item><item><title><![CDATA[Reply to toupper funktion on Thu, 18 May 2006 12:54:41 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=18363" rel="nofollow">Jochen Kalmbach</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=58" rel="nofollow">C++/CLI mit .NET</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1060123</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1060123</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Thu, 18 May 2006 12:54:41 GMT</pubDate></item><item><title><![CDATA[Reply to toupper funktion on Thu, 18 May 2006 13:00:05 GMT]]></title><description><![CDATA[<p>toupper arbeitet nur auf Einzelzeichen (int deshalb, weil die ganzen char-Funktionen (isalpha() oder toupper()) auch mit EOF-Werten rechnen können). Zeichenketten mußt du schon in einer Schleife einzeln umwandeln - oder per Algorithmus:</p>
<pre><code class="language-cpp">for(int i=0;i&lt;laenge;++i)
  erg+=toupper(rom[i]);

//oder:
transform(rom,rom+laenge,back_inserter(erg),toupper);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1060130</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1060130</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 18 May 2006 13:00:05 GMT</pubDate></item><item><title><![CDATA[Reply to toupper funktion on Thu, 18 May 2006 13:33:54 GMT]]></title><description><![CDATA[<p>oder</p>
<pre><code class="language-cpp">erg = rom;
use_facet&lt;ctype&lt;string::value_type&gt; &gt;(locale()).toupper(erg.begin(), erg.end());
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1060150</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1060150</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 18 May 2006 13:33:54 GMT</pubDate></item><item><title><![CDATA[Reply to toupper funktion on Thu, 18 May 2006 14:22:12 GMT]]></title><description><![CDATA[<p>Vielen Dank, ich werd's dann mal mit 'ner Schleife versuchen. Das Beispiel in der Hilfe, oder das was mein Vorgänger geschrieben hat, ist mir nämlich 3 Nummer zu hoch <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1060208</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1060208</guid><dc:creator><![CDATA[chris090980]]></dc:creator><pubDate>Thu, 18 May 2006 14:22:12 GMT</pubDate></item><item><title><![CDATA[Reply to toupper funktion on Thu, 08 Jun 2006 11:07:00 GMT]]></title><description><![CDATA[<p>Braunstein schrieb:</p>
<blockquote>
<p>oder</p>
<pre><code class="language-cpp">erg = rom;
use_facet&lt;ctype&lt;string::value_type&gt; &gt;(locale()).toupper(erg.begin(), erg.end());
</code></pre>
</blockquote>
<p>Ich bräuchte sowas noch für VC6. Wie geht das mit der dort mitgelieferten STL?</p>
<p>Dank im voraus!!!</p>
<p>Jens</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1073761</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1073761</guid><dc:creator><![CDATA[jencas]]></dc:creator><pubDate>Thu, 08 Jun 2006 11:07:00 GMT</pubDate></item><item><title><![CDATA[Reply to toupper funktion on Thu, 08 Jun 2006 13:03:04 GMT]]></title><description><![CDATA[<p>jencas schrieb:</p>
<blockquote>
<p>Braunstein schrieb:</p>
<blockquote>
<p>oder</p>
<pre><code class="language-cpp">erg = rom;
use_facet&lt;ctype&lt;string::value_type&gt; &gt;(locale()).toupper(erg.begin(), erg.end());
</code></pre>
</blockquote>
<p>Ich bräuchte sowas noch für VC6. Wie geht das mit der dort mitgelieferten STL?</p>
</blockquote>
<p>Beim VC 6 gibt es statt use_facet irgendwelche Makros. Schau einfach mal in der mitgelieferten Hilfe nach (Stichwort: use_facet).</p>
<p>Aus dem Kopf (hab keinen VC 6 mehr) würde ich sowas vermuten:</p>
<pre><code class="language-cpp">_USE(deinLocal, ctype&lt;string::value_type&gt; ).toupper(first, last);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1073865</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1073865</guid><dc:creator><![CDATA[HumeSikkins]]></dc:creator><pubDate>Thu, 08 Jun 2006 13:03:04 GMT</pubDate></item><item><title><![CDATA[Reply to toupper funktion on Thu, 08 Jun 2006 13:57:48 GMT]]></title><description><![CDATA[<p>Vielen Dank schon mal für Deine Hilfe. 33,333% Erfolg ;-), denn leider werden nur die ä's umgesetzt. Und tracen in die STL hat mich auch nicht wirklich weitergebracht.</p>
<p>Hier mal mein Codeschnipsel:</p>
<pre><code>using namespace std;

	locale loc(&quot;german_germany&quot;);
	string str = &quot;Alle Mädels haben immer öfter übermütige Anfälle&quot;;
	_USE(loc, ctype&lt;string::value_type&gt;).toupper(str.begin(), str.end());
</code></pre>
<p>Wobei ich mir nicht sicher bin, ob &quot;german_germany&quot; korrekt ist. Diese Info habe ich &quot;ge-group-googlet&quot; (<a href="http://groups.google.de" rel="nofollow">groups.google.de</a> in <a href="http://microsoft.public.de" rel="nofollow">microsoft.public.de</a>.*), also aus irgend einem uralten Usenet Beitrag.<br />
Wäre echt super, wenn mir da jemand weiterhelfen könnte.</p>
<p>Ciao</p>
<p>Jens</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1073910</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1073910</guid><dc:creator><![CDATA[jencas]]></dc:creator><pubDate>Thu, 08 Jun 2006 13:57:48 GMT</pubDate></item><item><title><![CDATA[Reply to toupper funktion on Fri, 09 Jun 2006 11:23:33 GMT]]></title><description><![CDATA[<pre><code>using namespace std;

void strupper(std::string &amp; s, std::locale const &amp; loc /*= std::locale()*/)
{
#ifdef _MFC_VER
	const ctype&lt;TCHAR&gt; &amp; ct = _USE(loc, ctype&lt;TCHAR&gt;);
#else
	const ctype&lt;char&gt; &amp; ct = use_facet&lt;ctype&lt;char&gt; &gt;(loc);
#endif
	for (std::string::iterator iter = s.begin(), end = s.end(); iter != end; ++iter)
		*iter = ct.toupper(*iter);
}
</code></pre>
<p>funktioniert jetzt für VC6 und <a href="http://VC.NET" rel="nofollow">VC.NET</a> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> , mal schauen, was Linux und Solaris dazu sagen. Ausserdem werde ich das ganze wohl noch durch ein basic_string Template ersetzen, dann sollte das auch z.B. für wide chars funktionieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1074527</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074527</guid><dc:creator><![CDATA[jencas]]></dc:creator><pubDate>Fri, 09 Jun 2006 11:23:33 GMT</pubDate></item></channel></rss>