<?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[Funktion für strings to ASCII-Zahl gesucht]]></title><description><![CDATA[<p>Ich suche eine Funktion, die einen string oder von mir aus auch ein char-Array in die Zahlen entsprechend der ASCII-Tabelle umwandelt. Buchstaben und ähnliches könnte man ja auch selbst vergleichen, aber Tabs und Zeilenumbrüche z.B. scheitern ja bei einem einfachen Vergleich. Deshalb wollte ich mal fragen, ob es dafür eine fertige Funktion gibt?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/250772/funktion-für-strings-to-ascii-zahl-gesucht</link><generator>RSS for Node</generator><lastBuildDate>Tue, 15 Sep 2026 17:58:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/250772.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 23 Sep 2009 19:43:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Funktion für strings to ASCII-Zahl gesucht on Wed, 23 Sep 2009 19:43:05 GMT]]></title><description><![CDATA[<p>Ich suche eine Funktion, die einen string oder von mir aus auch ein char-Array in die Zahlen entsprechend der ASCII-Tabelle umwandelt. Buchstaben und ähnliches könnte man ja auch selbst vergleichen, aber Tabs und Zeilenumbrüche z.B. scheitern ja bei einem einfachen Vergleich. Deshalb wollte ich mal fragen, ob es dafür eine fertige Funktion gibt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1783264</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1783264</guid><dc:creator><![CDATA[Little Programmer]]></dc:creator><pubDate>Wed, 23 Sep 2009 19:43:05 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion für strings to ASCII-Zahl gesucht on Wed, 23 Sep 2009 20:03:40 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">static_cast&lt;int&gt;(dein_char);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1783276</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1783276</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Wed, 23 Sep 2009 20:03:40 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion für strings to ASCII-Zahl gesucht on Thu, 24 Sep 2009 14:10:15 GMT]]></title><description><![CDATA[<p>lol, ich hab das neulich auch gefragt, wie mans macht, ohne das Zahlen gleich bleiben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1783618</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1783618</guid><dc:creator><![CDATA[5cript]]></dc:creator><pubDate>Thu, 24 Sep 2009 14:10:15 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion für strings to ASCII-Zahl gesucht on Thu, 24 Sep 2009 14:16:23 GMT]]></title><description><![CDATA[<p>Little Programmer schrieb:</p>
<blockquote>
<p>aber Tabs und Zeilenumbrüche z.B. scheitern ja bei einem einfachen Vergleich.</p>
</blockquote>
<p>nö, wieso? brauchst aber auch nix vergleichen.</p>
<pre><code class="language-cpp">void ascii_view(const string&amp; s)
{
	int sz = s.size();
	for ( int i = 0; i&lt;sz; i++ )
		cout &lt;&lt; s[i] &lt;&lt; &quot; &quot; &lt;&lt; (int)s[i] &lt;&lt; endl;
}

int main() 
{ 
	string str = &quot;View my ASCII code.&quot;;
	ascii_view(str);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1783620</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1783620</guid><dc:creator><![CDATA[codegenerator]]></dc:creator><pubDate>Thu, 24 Sep 2009 14:16:23 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion für strings to ASCII-Zahl gesucht on Thu, 24 Sep 2009 14:24:41 GMT]]></title><description><![CDATA[<p>Little Programmer schrieb:</p>
<blockquote>
<p>Ich suche eine Funktion, die einen string oder von mir aus auch ein char-Array in die Zahlen entsprechend der ASCII-Tabelle umwandelt.</p>
</blockquote>
<p>Da muss man eigentlich nix umwandeln, da char bereits ein integraler Typ ist. Ein char ist eine Zahl! Nur die Interpretation von z.B. std::cout sorgt dafür, dass du einen Buchstaben statt einer Zahl ausgegeben bekommst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1783630</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1783630</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Thu, 24 Sep 2009 14:24:41 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion für strings to ASCII-Zahl gesucht on Mon, 28 Sep 2009 14:38:36 GMT]]></title><description><![CDATA[<p>Danke für eure Antworten. Heist das, ich kann einfach:</p>
<pre><code class="language-cpp">string b = &quot;Hallo&quot;;
int a = b[0];
</code></pre>
<p>Dürfte eine Warnung des Compilers ausspucken, aber machbar wäre es in beide Richtungen, oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1785469</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1785469</guid><dc:creator><![CDATA[Little Programmer]]></dc:creator><pubDate>Mon, 28 Sep 2009 14:38:36 GMT</pubDate></item></channel></rss>