<?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[Eine long-Variablen in zwei Teile spalten]]></title><description><![CDATA[<p>Hey,<br />
ich habe eine lonag-Variable und möchte den Wert in zwei Teile als Hexadezimalzahl ausgeben, wie kann ich die long-Variable teilen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/172564/eine-long-variablen-in-zwei-teile-spalten</link><generator>RSS for Node</generator><lastBuildDate>Fri, 18 Sep 2026 01:41:44 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/172564.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 06 Feb 2007 11:43:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Eine long-Variablen in zwei Teile spalten on Tue, 06 Feb 2007 11:43:24 GMT]]></title><description><![CDATA[<p>Hey,<br />
ich habe eine lonag-Variable und möchte den Wert in zwei Teile als Hexadezimalzahl ausgeben, wie kann ich die long-Variable teilen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1223746</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1223746</guid><dc:creator><![CDATA[radian]]></dc:creator><pubDate>Tue, 06 Feb 2007 11:43:24 GMT</pubDate></item><item><title><![CDATA[Reply to Eine long-Variablen in zwei Teile spalten on Tue, 06 Feb 2007 11:45:31 GMT]]></title><description><![CDATA[<p>Durch shiften und maskieren der Bitfolge deines Wertes.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1223747</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1223747</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Tue, 06 Feb 2007 11:45:31 GMT</pubDate></item><item><title><![CDATA[Reply to Eine long-Variablen in zwei Teile spalten on Tue, 06 Feb 2007 11:46:59 GMT]]></title><description><![CDATA[<p>Am besten mit Bit-Operatoren:</p>
<pre><code class="language-cpp">long val;
int hi=val&gt;&gt;16;
int lo=val&amp;0xFFFF;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1223748</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1223748</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 06 Feb 2007 11:46:59 GMT</pubDate></item><item><title><![CDATA[Reply to Eine long-Variablen in zwei Teile spalten on Tue, 06 Feb 2007 11:49:11 GMT]]></title><description><![CDATA[<p>oder so:</p>
<pre><code class="language-cpp">long x = 2348925ul;

short a, b;

a = ((short*)&amp;x)[0];
b = ((short*)&amp;x)[1];
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1223750</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1223750</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 06 Feb 2007 11:49:11 GMT</pubDate></item><item><title><![CDATA[Reply to Eine long-Variablen in zwei Teile spalten on Tue, 06 Feb 2007 11:53:06 GMT]]></title><description><![CDATA[<p>@Stöffel: Bleiben wir doch lieber bei Lösungsansätzen, die vom ANSI-Standard unterstützt werden <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1223754</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1223754</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 06 Feb 2007 11:53:06 GMT</pubDate></item><item><title><![CDATA[Reply to Eine long-Variablen in zwei Teile spalten on Tue, 06 Feb 2007 12:01:42 GMT]]></title><description><![CDATA[<p>CStoll schrieb:</p>
<blockquote>
<p>@Stöffel: Bleiben wir doch lieber bei Lösungsansätzen, die vom ANSI-Standard unterstützt werden <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>
</blockquote>
<p>Könntest du mich aufklären, was daran nicht standardgemäss ist? <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="😕"
    /> Ist es das Problem das short und long gleich gross sein könnten?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1223767</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1223767</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 06 Feb 2007 12:01:42 GMT</pubDate></item><item><title><![CDATA[Reply to Eine long-Variablen in zwei Teile spalten on Tue, 06 Feb 2007 12:07:53 GMT]]></title><description><![CDATA[<p>Das und die Tatsache, daß dein Typ-Cast irgendwo im Bereich &quot;implementation-defined behaviour&quot; angesiedelt ist.</p>
<p>(außerdem müsstest du raten, welcher der Werte a und b nun die obere Hälfte des eingegebenen long-Wertes ist ;))</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1223771</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1223771</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 06 Feb 2007 12:07:53 GMT</pubDate></item><item><title><![CDATA[Reply to Eine long-Variablen in zwei Teile spalten on Tue, 06 Feb 2007 12:09:35 GMT]]></title><description><![CDATA[<p>Danke, hab es schon hinbekommen. Trotzdem danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1223773</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1223773</guid><dc:creator><![CDATA[radian]]></dc:creator><pubDate>Tue, 06 Feb 2007 12:09:35 GMT</pubDate></item><item><title><![CDATA[Reply to Eine long-Variablen in zwei Teile spalten on Tue, 06 Feb 2007 13:26:31 GMT]]></title><description><![CDATA[<p>CStoll schrieb:</p>
<blockquote>
<p>Am besten mit Bit-Operatoren:</p>
<pre><code class="language-cpp">long val;
int hi=val&gt;&gt;16;
int lo=val&amp;0xFFFF;
</code></pre>
</blockquote>
<p>Das wird so aber nicht korrekt funktionieren, da signed Shiften implementationsspezifisch ist. Und idR implementieren Compiler signed Shiften arithmetisch. Lösung: val vorher in unsigned long umwandeln.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1223833</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1223833</guid><dc:creator><![CDATA[groovemaster]]></dc:creator><pubDate>Tue, 06 Feb 2007 13:26:31 GMT</pubDate></item></channel></rss>