<?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[unsigned char als byte ???]]></title><description><![CDATA[<p>Hi,<br />
ich habe eine Variable 'unsigned char WERT'. Diese fülle ich mit der Zahl 99.<br />
Wenn ich jetzt diese Variable aufrufe, bekomme ich als Wert ein 'c' (ASCII = 99)!!!<br />
Ich brauche aber die Zahl 99 als Byte-Wert!!!<br />
Wie geht das...???</p>
<p>Gruß torsten</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/76980/unsigned-char-als-byte</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 16:00:57 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/76980.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 16 Jun 2004 14:22:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to unsigned char als byte ??? on Wed, 16 Jun 2004 14:22:42 GMT]]></title><description><![CDATA[<p>Hi,<br />
ich habe eine Variable 'unsigned char WERT'. Diese fülle ich mit der Zahl 99.<br />
Wenn ich jetzt diese Variable aufrufe, bekomme ich als Wert ein 'c' (ASCII = 99)!!!<br />
Ich brauche aber die Zahl 99 als Byte-Wert!!!<br />
Wie geht das...???</p>
<p>Gruß torsten</p>
]]></description><link>https://www.c-plusplus.net/forum/post/541644</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/541644</guid><dc:creator><![CDATA[torsten_156]]></dc:creator><pubDate>Wed, 16 Jun 2004 14:22:42 GMT</pubDate></item><item><title><![CDATA[Reply to unsigned char als byte ??? on Wed, 16 Jun 2004 14:31:36 GMT]]></title><description><![CDATA[<p>Wie rufst du sie denn auf? Evtl. musst du sie auch erst nach int casten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/541652</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/541652</guid><dc:creator><![CDATA[Dasd]]></dc:creator><pubDate>Wed, 16 Jun 2004 14:31:36 GMT</pubDate></item><item><title><![CDATA[Reply to unsigned char als byte ??? on Wed, 16 Jun 2004 14:37:48 GMT]]></title><description><![CDATA[<p>Was vestehst du unter 99 als Byte? Was ist deine 99? Ein dezimaler Wert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/541657</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/541657</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 16 Jun 2004 14:37:48 GMT</pubDate></item><item><title><![CDATA[Reply to unsigned char als byte ??? on Wed, 16 Jun 2004 14:44:04 GMT]]></title><description><![CDATA[<p>sorry,<br />
ich sollte es doch lieber ausführlich schreiben:<br />
Ich habe ein Interface über USB angeschlossen. Nun möchte ich, das einzelne Bits gesetzt werden. Dazu wird über ein 'DeviceIOControl'-Aufruf das Byte geschickt. Man kann natürlich mit WERT=1 das erste Bit setzen(teoretisch). Aber es wird ja nicht eine 1 als Byte-Wert sondern ein ASCII-Zeichen geschickt!!! Das verursacht natürlich einen Fehler...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/541663</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/541663</guid><dc:creator><![CDATA[torsten_156]]></dc:creator><pubDate>Wed, 16 Jun 2004 14:44:04 GMT</pubDate></item><item><title><![CDATA[Reply to unsigned char als byte ??? on Wed, 16 Jun 2004 15:08:21 GMT]]></title><description><![CDATA[<p>Und was genau hat das mit dem BCB zu tun!?<br />
Da du DeviceIOControl erwähnst und das Problem offensichtlich bei der Übergabe korrekter Parameter liegt verschieb ich dich mal nach WinAPI.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/541690</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/541690</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Wed, 16 Jun 2004 15:08:21 GMT</pubDate></item><item><title><![CDATA[Reply to unsigned char als byte ??? on Wed, 16 Jun 2004 15:08:36 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=437" rel="nofollow">Jansen</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=2" rel="nofollow">Borland C++ Builder (VCL/CLX)</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=4" rel="nofollow">WinAPI</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/541692</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/541692</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Wed, 16 Jun 2004 15:08:36 GMT</pubDate></item><item><title><![CDATA[Reply to unsigned char als byte ??? on Wed, 16 Jun 2004 15:16:26 GMT]]></title><description><![CDATA[<p>mal ein auszug aus windows.h oder so da steht</p>
<pre><code class="language-cpp">#define BYTE unsigned char
</code></pre>
<p>ist also gehüpft wie gesprungen. wenn du das erste bit setzen willst dann mach doch einfach folgendes:</p>
<pre><code class="language-cpp">unsigned char c = 1;
</code></pre>
<p>damit wird nur das erste bit gesetzt, weil er ja von int(1) zu unsigned char castet</p>
]]></description><link>https://www.c-plusplus.net/forum/post/541707</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/541707</guid><dc:creator><![CDATA[fallen]]></dc:creator><pubDate>Wed, 16 Jun 2004 15:16:26 GMT</pubDate></item><item><title><![CDATA[Reply to unsigned char als byte ??? on Wed, 16 Jun 2004 16:33:50 GMT]]></title><description><![CDATA[<p>genau da liegt ja das Problem. Wenn ich die Variable BYTE = 1 setzte, wird aus der 1 ein Zeichen der ASCII-Tabelle! (und zwar das mit der Nr.1)<br />
Wenn ich z.B. das 8. Bit setzen möchte, sprich BYTE = 128, dann übergibt er nicht die 128 sondern ein € (€ steht in der ASCII-Tab als 128. Zeichen)...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/541781</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/541781</guid><dc:creator><![CDATA[torsten_156]]></dc:creator><pubDate>Wed, 16 Jun 2004 16:33:50 GMT</pubDate></item><item><title><![CDATA[Reply to unsigned char als byte ??? on Wed, 16 Jun 2004 16:55:22 GMT]]></title><description><![CDATA[<p>Halte mich für blöd... aber da besteht doch überhaupt <strong>kein</strong> Unterschied. Der einzige Unterschied besteht in der Interpretation des Wertes.<br />
Es würde genausowenig einen Unterschied machen, wenn Du z.B. das hier versuchen würdest:</p>
<pre><code class="language-cpp">char a = 'A';
std::cout &lt;&lt; a;
a = 65; //Der ASCII-Wert von 'A'
cout &lt;&lt; a;
</code></pre>
<p>Die Bits sind genauso gesetzt, also: wo ist dein Problem?!? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/541794</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/541794</guid><dc:creator><![CDATA[Deadlef]]></dc:creator><pubDate>Wed, 16 Jun 2004 16:55:22 GMT</pubDate></item><item><title><![CDATA[Reply to unsigned char als byte ??? on Wed, 16 Jun 2004 20:01:38 GMT]]></title><description><![CDATA[<p>Es kann aber auch sein, dass <strong>ICH</strong> da was nicht ganz verstehe! Also, ich muß dem Interface per DeviceIOControl eine Zahl im BYTE-Format übergeben. Wenn ich im Quellcode eine Haltemarke setze und den Cursor auf meine Variable setze, erscheint dann als Wert das ASCII-Zeichen. Da muß doch aber eine Zahl stehen, oder...?<br />
Ich gebe mal mein Code mit...</p>
<pre><code>byte compulab::schreiben_lesen_Digital(unsigned char wert)
   {
   Ausgang_bValue1 = wert; //hier steht das Bitmuster
   Ausgang_bFunction=6;
   bResult= DeviceIoControl(hgDriver,COMPULAB_IOCTR,&amp;Ausgang, sizeof(Ausgang),&amp;Eingang,sizeof(Eingang),&amp;count,NULL);
   return bResult;
   };
</code></pre>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/541924</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/541924</guid><dc:creator><![CDATA[torsten_156]]></dc:creator><pubDate>Wed, 16 Jun 2004 20:01:38 GMT</pubDate></item><item><title><![CDATA[Reply to unsigned char als byte ??? on Wed, 16 Jun 2004 20:04:06 GMT]]></title><description><![CDATA[<p>torsten_156 schrieb:</p>
<blockquote>
<p>Wenn ich im Quellcode eine Haltemarke setze und den Cursor auf meine Variable setze, erscheint dann als Wert das ASCII-Zeichen. Da muß doch aber eine Zahl stehen, oder...?</p>
</blockquote>
<p>Das stört eigentlich nicht - ist ja nur eine Frage der Darstellungsweise <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/541927</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/541927</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Wed, 16 Jun 2004 20:04:06 GMT</pubDate></item><item><title><![CDATA[Reply to unsigned char als byte ??? on Wed, 16 Jun 2004 20:11:05 GMT]]></title><description><![CDATA[<p>jo,<br />
nach weiteren Tests habe ich feststellen müssen, daß die Deklaration meiner Variablen den Fehler garnicht verursacht!!! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f576.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--sunglasses"
      title=":sunglasses:"
      alt="🕶"
    /><br />
Die Lämpchen meines Interfaces leuchten auch so...</p>
<p>NOCHMALS DANKE für die Hilfen...</p>
<p>Gruß Torsten</p>
]]></description><link>https://www.c-plusplus.net/forum/post/541935</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/541935</guid><dc:creator><![CDATA[torsten_156]]></dc:creator><pubDate>Wed, 16 Jun 2004 20:11:05 GMT</pubDate></item></channel></rss>