<?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[C++ Abfrage]]></title><description><![CDATA[<p>Hi leute möchte ne CMD Abfrage machen (Bin neu im C++)</p>
<p>Nun habe ich mal ein HEX &quot;umrechner&quot; gemacht</p>
<p>int main()<br />
{<br />
cout &lt;&lt; &quot;Wert von 27 = &quot; &lt;&lt; hex &lt;&lt; 27 &lt;&lt;&quot; hexadezimal&quot;<br />
&lt;&lt; endl;</p>
<p>Nun meine frage: Wie Baue ich da jetzt ne Abfrage rein? z.b<br />
man muss ne Zahl eintippen und kriegt dann die HEX dafür...</p>
<p>mag ja net jeden einzeln da eintippen <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>
<p>Vielen Dank im vorraus</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/189954/c-abfrage</link><generator>RSS for Node</generator><lastBuildDate>Fri, 25 Sep 2026 12:56:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/189954.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 19 Aug 2007 09:09:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to C++ Abfrage on Sun, 19 Aug 2007 09:09:52 GMT]]></title><description><![CDATA[<p>Hi leute möchte ne CMD Abfrage machen (Bin neu im C++)</p>
<p>Nun habe ich mal ein HEX &quot;umrechner&quot; gemacht</p>
<p>int main()<br />
{<br />
cout &lt;&lt; &quot;Wert von 27 = &quot; &lt;&lt; hex &lt;&lt; 27 &lt;&lt;&quot; hexadezimal&quot;<br />
&lt;&lt; endl;</p>
<p>Nun meine frage: Wie Baue ich da jetzt ne Abfrage rein? z.b<br />
man muss ne Zahl eintippen und kriegt dann die HEX dafür...</p>
<p>mag ja net jeden einzeln da eintippen <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>
<p>Vielen Dank im vorraus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1347220</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1347220</guid><dc:creator><![CDATA[cica]]></dc:creator><pubDate>Sun, 19 Aug 2007 09:09:52 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Abfrage on Sun, 19 Aug 2007 10:15:17 GMT]]></title><description><![CDATA[<p>Also Abfragen kannste mit ner Switch-Anweisung abfangen. Problem ist aber nur, dass du dir da schon zur Entwurfszeit überlegen musst, wie viele Zahlen und welche du abfangen willst...</p>
<p>Eleganter wäre es, ne Zahl einzulesen, und diese mit nem Algorythmus in Hexadezimal umzurechnen. Wie die Umrechnung geht, steht sicher in Wikipedia oder Google...<br />
Da bist du dann eben frei, was den Zahlenbereich angeht!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1347255</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1347255</guid><dc:creator><![CDATA[NewtonsLaw]]></dc:creator><pubDate>Sun, 19 Aug 2007 10:15:17 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Abfrage on Sun, 19 Aug 2007 10:32:10 GMT]]></title><description><![CDATA[<p>NewtonsLaw schrieb:</p>
<blockquote>
<p>Also Abfragen kannste mit ner Switch-Anweisung abfangen. Problem ist aber nur, dass du dir da schon zur Entwurfszeit überlegen musst, wie viele Zahlen und welche du abfangen willst...</p>
<p>Eleganter wäre es, ne Zahl einzulesen, und diese mit nem Algorythmus in Hexadezimal umzurechnen. Wie die Umrechnung geht, steht sicher in Wikipedia oder Google...<br />
Da bist du dann eben frei, was den Zahlenbereich angeht!</p>
</blockquote>
<p>ehm naja wie gesagt bin n rechter Neuling <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="😉"
    /> kA was algorythtmus ist ^^<br />
und wie würde das denn mit switch funktionieren?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1347269</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1347269</guid><dc:creator><![CDATA[cica]]></dc:creator><pubDate>Sun, 19 Aug 2007 10:32:10 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Abfrage on Sun, 19 Aug 2007 11:13:39 GMT]]></title><description><![CDATA[<p>Die Dezimalzahl 100 wird ins Hexadezimalsystem umgewandelt</p>
<p>Gehe nach folgendem Verfahren vor:<br />
(1) Teile die Zahl mit Rest durch 16.<br />
(2) Der Divisionsrest ist die nächste Ziffer (von rechts nach links).<br />
Für Reste &gt; 9 nimm die Buchstaben A, B, C, D, E, F<br />
(3) Falls der (ganzzahlige) Quotient = 0 ist, bist du fertig,<br />
andernfalls nimm den (ganzzahligen) Quotienten als neue Zahl<br />
und wiederhole ab (1).</p>
<p>100 : 16 = 6 Rest: 4 --&gt; Ziffer: 4<br />
6 : 16 = 0 Rest: 6 --&gt; Ziffer: 6</p>
<p>Resultat: 64</p>
<p>Die Hexadezimalzahl 64 wird ins Dezimalsystem umgewandelt</p>
<p>Jede Stelle der Zahl hat den Wert der entsprechenden Potenz von 16;<br />
die rechte Ziffer entspricht 16º=1, die zweite von rechts 16¹=16 usw.<br />
Nimm jede Ziffer bzw. ihren Zahlenwert (A=10, B=11, ... )<br />
mal mit der entsprechenden Potenz und summiere.<br />
Gehe am besten von rechts nach links vor:</p>
<p>4: 4 · 1 = 4<br />
6: 6 · 16 = 96<br />
———<br />
100</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1347289</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1347289</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 19 Aug 2007 11:13:39 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Abfrage on Sun, 19 Aug 2007 16:34:09 GMT]]></title><description><![CDATA[<p>Was spricht denn gegen</p>
<pre><code class="language-cpp">int main() 
{ 
char zahl = 27;
cout &lt;&lt; &quot;Wert von &quot;&lt;&lt; zahl &lt;&lt; &quot;= &quot; &lt;&lt; hex &lt;&lt; zahl &lt;&lt;&quot; hexadezimal&quot; 
&lt;&lt; endl;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1347662</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1347662</guid><dc:creator><![CDATA[Knuddlbaer]]></dc:creator><pubDate>Sun, 19 Aug 2007 16:34:09 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Abfrage on Sun, 19 Aug 2007 16:44:21 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-18363.html" rel="nofollow">Jochen Kalmbach</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-58.html" rel="nofollow">C++/CLI mit .NET</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" 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/1347664</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1347664</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Sun, 19 Aug 2007 16:44:21 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Abfrage on Sun, 19 Aug 2007 16:44:46 GMT]]></title><description><![CDATA[<blockquote>
<p>&quot;Knuddlbaer&quot;Was spricht denn gegen</p>
</blockquote>
<p>Die Ausgabe.<br />
Müsste es nicht mit einem int gemacht werden?</p>
<pre><code class="language-cpp">int zahl = 27; 
cout &lt;&lt; &quot;Wert von &quot;&lt;&lt; zahl &lt;&lt; &quot;= &quot; &lt;&lt; hex &lt;&lt; zahl &lt;&lt;&quot; hexadezimal&quot; 
&lt;&lt; endl;
</code></pre>
<p>Sonst spricht da nix gegen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1347665</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1347665</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 19 Aug 2007 16:44:46 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Abfrage on Sun, 19 Aug 2007 16:46:30 GMT]]></title><description><![CDATA[<p>char 27 ist das gleiche wie int 27 oder long 27.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1347666</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1347666</guid><dc:creator><![CDATA[Knuddlbaer]]></dc:creator><pubDate>Sun, 19 Aug 2007 16:46:30 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Abfrage on Sun, 19 Aug 2007 16:56:03 GMT]]></title><description><![CDATA[<p>Knuddlbaer schrieb:</p>
<blockquote>
<p>char 27 ist das gleiche wie int 27 oder long 27.</p>
</blockquote>
<p>Aber der Overload von op&lt;&lt; für char gibt doch ein Ascii-Zeichen und nicht die Wertigkeit des char aus oder?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1347674</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1347674</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Sun, 19 Aug 2007 16:56:03 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Abfrage on Sun, 19 Aug 2007 17:42:56 GMT]]></title><description><![CDATA[<p>Das ist die Ausgabe mit char.<br />
<a href="http://www.rb-softarticle.com/char.jpg" rel="nofollow">http://www.rb-softarticle.com/char.jpg</a></p>
<p>Das ist die Ausgabe mit int.<br />
<a href="http://www.rb-softarticle.com/int.jpg" rel="nofollow">http://www.rb-softarticle.com/int.jpg</a></p>
<p>Ich kenne den char als Char aus C++/CLI und da ist er nur für ein Zeichen.<br />
Was ist da jetzt nicht Ok?<br />
Warum ist die Ausgabe mit char nicht wie gewünscht, wenn beide doch das selbe oder das gleiche sind?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1347697</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1347697</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 19 Aug 2007 17:42:56 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Abfrage on Sun, 19 Aug 2007 17:48:05 GMT]]></title><description><![CDATA[<p>Doug_HH schrieb:</p>
<blockquote>
<p>Warum ist die Ausgabe mit char nicht wie gewünscht, wenn beide doch das selbe oder das gleiche sind?</p>
</blockquote>
<p>Siehe meine Antwort <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>
<p>Ein char ist ein Ganzzahltyp der ein Zeichen speichern kann. Das Zeichen hat einen Wert (27) und eine Darstellung (Pfeilchen links). Der operator&lt;&lt; von ostream zeigt die Darstellung am Bildschirm an, und nicht die Wertigkeit.</p>
<p>In C# ist char tatsächlich restriktiver. Die Zuweisung einer Zahl an ein char würde ohne explizite Umwandlung fehlschlagen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1347701</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1347701</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Sun, 19 Aug 2007 17:48:05 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Abfrage on Sun, 19 Aug 2007 18:12:57 GMT]]></title><description><![CDATA[<p>In c# müsste man dafür ein byte verwenden um ein &quot;c++ char&quot; zu erhalten.</p>
<p>byte yx = 27;</p>
<p>Gedanklich war das char = 27 auf &quot;den kleinstmöglichen Typ&quot; verwenden ausgelegt und der Post danach sollte nichts anderes sagen als &quot;Es muss kein int sein&quot;.</p>
<p>An das verhalten vom op&lt;&lt; hab ich dabei nicht gedacht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1347716</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1347716</guid><dc:creator><![CDATA[Knuddlbaer]]></dc:creator><pubDate>Sun, 19 Aug 2007 18:12:57 GMT</pubDate></item></channel></rss>