<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><font face="Arial">Ano</font><br>
    </p>
    <pre class="moz-signature" cols="72">Martin Záruba</pre>
    <div class="moz-cite-prefix">Dne 15.4.2024 v 13:52 Jan Waclawek
      napsal(a):<br>
    </div>
    <blockquote type="cite"
      cite="mid:PC195202404151352210864c685c7b5@wekPC">
      <pre class="moz-quote-pre" wrap="">Serial.print zrejme znamena Arduino, cize AVR (aj je pravda ze to uz dnes
nemusi platit), cize ano.

wek


----- Original Message ---------------
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">FormátovacĂ­ znak "u" znamená unsigned int, coĹľ nemusĂ­ nutnÄ› bĂ˝t uint32_t.
NenĂ­ sizeof(unsigned) = 2?

L.


On 15.04.2024 13:41, Jaroslav Buchta wrote:
</pre>
        <blockquote type="cite">
          <pre class="moz-quote-pre" wrap="">sprintf(sStringBuffer,"%6u",123456UL);

Asi to bere konstantu implicitne jako 16b


Dne 15.04.2024 v 13:38 Jindroush napsal(a):
</pre>
          <blockquote type="cite">
            <pre class="moz-quote-pre" wrap="">ProstÄ› se to nÄ›kde orizne na 16bitĹŻ. Nemá to bĂ˝t ul?
OpÄ›t upozorňuji na zdravĂ˝ zvyk používat snprintf...
J.

---------- PĹŻvodnĂ­ e-mail ----------
Od: Martin Záruba <a class="moz-txt-link-rfc2396E" href="mailto:swz@volny.cz"><swz@volny.cz></a>
Komu: Martin Zaruba <a class="moz-txt-link-rfc2396E" href="mailto:hw-list@list.hw.cz"><hw-list@list.hw.cz></a>
Datum: 15.04.2024 13:35:10
PĹ™edmÄ›t: sprintf - co dÄ›lám blbÄ›?



    Tento triviálnĂ­ kousek programu


    charsStringBuffer[50];
    sprintf(sStringBuffer,"%6u",(uint32_t)123456);
    Serial.print(sStringBuffer);


    vracĂ­ hodnotu 57920. Ale proÄŤ?


    -- 

    Martin Záruba

</pre>
          </blockquote>
        </blockquote>
        <pre class="moz-quote-pre" wrap="">
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
_______________________________________________
HW-list mailing list  -  sponsored by <a class="moz-txt-link-abbreviated" href="http://www.HW.cz">www.HW.cz</a>
<a class="moz-txt-link-abbreviated" href="mailto:Hw-list@list.hw.cz">Hw-list@list.hw.cz</a>
<a class="moz-txt-link-freetext" href="http://list.hw.cz/mailman/listinfo/hw-list">http://list.hw.cz/mailman/listinfo/hw-list</a>
</pre>
    </blockquote>
  </body>
</html>