<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>CodeWarrior for MCU中的主题 sprintf not printing 32 bit variables correctly</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/sprintf-not-printing-32-bit-variables-correctly/m-p/148303#M3460</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Hello Experts &lt;SPAN aria-label="Happy" class="emoticon_happy emoticon-inline" style="height:16px;width:16px;"&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am printing an unsigned 32-bit integer as following:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;sprintf(str,"%8X", (unsigned long) sig_pow);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;where sig_pow is defined as unigned long itself. But strangely it always prints the upper 2 bytes, i.e.,&amp;nbsp;most significant&amp;nbsp;4 hex characters. Anyone has some idea on what is going wrong?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks&lt;/DIV&gt;&lt;DIV&gt;deneb&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Feb 2009 21:20:39 GMT</pubDate>
    <dc:creator>deneb</dc:creator>
    <dc:date>2009-02-02T21:20:39Z</dc:date>
    <item>
      <title>sprintf not printing 32 bit variables correctly</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/sprintf-not-printing-32-bit-variables-correctly/m-p/148303#M3460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Hello Experts &lt;SPAN aria-label="Happy" class="emoticon_happy emoticon-inline" style="height:16px;width:16px;"&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am printing an unsigned 32-bit integer as following:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;sprintf(str,"%8X", (unsigned long) sig_pow);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;where sig_pow is defined as unigned long itself. But strangely it always prints the upper 2 bytes, i.e.,&amp;nbsp;most significant&amp;nbsp;4 hex characters. Anyone has some idea on what is going wrong?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks&lt;/DIV&gt;&lt;DIV&gt;deneb&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2009 21:20:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/sprintf-not-printing-32-bit-variables-correctly/m-p/148303#M3460</guid>
      <dc:creator>deneb</dc:creator>
      <dc:date>2009-02-02T21:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: sprintf not printing 32 bit variables correctly</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/sprintf-not-printing-32-bit-variables-correctly/m-p/148304#M3461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi daneb,&lt;BR /&gt;&lt;BR /&gt;I'd suggest you to try:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;sprintf(str,"%8LX",sig_pow);&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;this might help...&lt;BR /&gt;&lt;BR /&gt;stanish&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2009 22:46:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/sprintf-not-printing-32-bit-variables-correctly/m-p/148304#M3461</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2009-02-02T22:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: sprintf not printing 32 bit variables correctly</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/sprintf-not-printing-32-bit-variables-correctly/m-p/148305#M3462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;The %X specifier takes an int as argument, so the compiler behaves as expected.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 15:26:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/sprintf-not-printing-32-bit-variables-correctly/m-p/148305#M3462</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2009-02-03T15:26:39Z</dc:date>
    </item>
  </channel>
</rss>

