<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>What is the advantage of uint8_t over char or bool?</title><link>https://community.arm.com/developer/tools-software/tools/f/arm-compilers-forum/47990/what-is-the-advantage-of-uint8_t-over-char-or-bool</link><description> I have to migrate some C++ functions into a &amp;micro;Vision project and usually you use uint8_t instead of char and bool. Is there any downside to using bool? I mean including the bool.h will not make the code significantly larger. </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: What is the advantage of uint8_t over char or bool?</title><link>https://community.arm.com/thread/168535?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2020 12:11:49 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2859f054-e4ba-49f9-b95e-14ddca72fae7</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;it&amp;#39;s not about printing - it&amp;#39;s about the intended use of the variable:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If the&amp;nbsp;&lt;span&gt;intended use of the variable is to hold an unsigned numerical value, use uint8_t;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;If the&amp;nbsp;&lt;span&gt;intended use of the variable is to hold a signed numerical value, use int8_t;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;If the&amp;nbsp;&lt;span&gt;intended use of the variable is to hold a printable character, use char.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the advantage of uint8_t over char or bool?</title><link>https://community.arm.com/thread/168534?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2020 11:58:07 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:290b1768-fb36-4467-8429-ccfa01911594</guid><dc:creator>coldspark</dc:creator><description>&lt;p&gt;I can also print the uint8_t without problems. But that means there is no good reason to use these datatypes?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the advantage of uint8_t over char or bool?</title><link>https://community.arm.com/thread/168512?ContentTypeID=1</link><pubDate>Fri, 06 Nov 2020 21:46:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:21938c33-544f-40d9-ba1d-746beff5f2b3</guid><dc:creator>Andy Neil</dc:creator><description>[quote userid="67560" url="~/developer/tools-software/tools/f/arm-compilers-forum/47990/what-is-the-advantage-of-uint8_t-over-char-or-bool"]you use uint8_t instead of char[/quote]
&lt;p&gt;only for an unsigned 8-bit &lt;em&gt;number&lt;/em&gt;; if you actually want a printable &lt;em&gt;character&lt;/em&gt;, then use char.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>