{"id":10437,"date":"2022-07-16T04:19:34","date_gmt":"2022-07-16T04:19:34","guid":{"rendered":"http:\/\/fastbitlab.com\/?p=10437"},"modified":"2023-02-10T16:40:13","modified_gmt":"2023-02-10T11:10:13","slug":"microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h","status":"publish","type":"post","link":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\/","title":{"rendered":"Microcontroller Embedded C Programming Lecture 77| Importance of stdint.h"},"content":{"rendered":"<div class=\"boldgrid-section\" style=\"background-image: linear-gradient(to left, #eeeeee, #eeeeee);\" data-bg-color-1=\"#EEEEEE\" data-bg-color-2=\"#EEEEEE\" data-bg-direction=\"to left\">\n<div class=\"container\">\n<div class=\"row\" style=\"padding-top: 35px; padding-bottom: 0px; background-image: linear-gradient(to left, #eeeeee, #eeeeee);\" data-bg-color-1=\"#EEEEEE\" data-bg-color-2=\"#EEEEEE\" data-bg-direction=\"to left\">\n<div class=\"col-md-1 col-sm-12 col-xs-12 col-lg-1\">\n<div class=\"boldgrid-shortcode\" data-imhwpb-draggable=\"true\">\n\n<\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<div class=\"col-md-10 col-sm-12 col-xs-12 col-lg-10\">\n<h1 class=\"\" style=\"text-align: center; font-size: 36px; border-width: 0px; line-height: 53px;\"><span style=\"color: #000080;\"><strong>Importance of &lt;stdint.h&gt;<\/strong><\/span><\/h1>\n<div class=\"row bg-editor-hr-wrap\" style=\"border-width: 0px; margin-top: -25px;\">\n<div class=\"col-lg-12 col-md-12 col-xs-12 col-sm-12\">\n<div>\n<p>&nbsp;<\/p>\n<div class=\"bg-hr bg-hr-10 color2-color\" style=\"border-style: solid; border-width: 0px 0px 3px;\"><\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">In this article, let&#8217;s learn about the importance of &lt;stdint.h&gt;. &lt;stdint.h&gt; is one of the standard library header file.<\/span><\/p>\n<figure id=\"attachment_10440\" aria-describedby=\"caption-attachment-10440\" style=\"width: 634px\" class=\"wp-caption aligncenter\"><img fetchpriority=\"high\" decoding=\"async\" class=\"wp-image-10440\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-1-22-1024x548.png\" alt=\"Figure 1. Importance of stdint.h\" width=\"634\" height=\"339\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-22-1024x548.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-22-300x161.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-22-768x411.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-22-600x321.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-22-1536x822.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-22-120x64.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-22-500x268.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-22-200x107.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-22-400x214.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-22-800x428.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-22-1200x642.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-22.png 1885w\" sizes=\"(max-width: 634px) 100vw, 634px\" \/><figcaption id=\"caption-attachment-10440\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 1. Importance of stdint.h <\/span><\/figcaption><\/figure>\n<p class=\"\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">Let&#8217;s say you have written a &#8216;C&#8217; program, keeping in mind certain data types and its associated sizes. Now, let\u2019s say tomorrow you change the compiler; when you change the compiler, the size of the data type may differ. <\/span><\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">So, the code may compile fine, but it may be buggy because the new compiler uses different sizes for the data types you have used in the program. That means you will face portability issues with your code. So, there will not be a problem when you use your compiler, but if the same code is compiled using another compiler, there&#8217;s a possibility that the code may become buggy, and it will cause problems<\/span><span style=\"font-weight: 400;\">.<\/span><\/span><\/p>\n<figure id=\"attachment_10441\" aria-describedby=\"caption-attachment-10441\" style=\"width: 611px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-10441\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-2-19-1024x392.png\" alt=\"Importance of stdint.h\" width=\"611\" height=\"234\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-19-1024x392.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-19-300x115.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-19-768x294.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-19-600x230.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-19-1536x588.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-19-120x46.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-19-500x192.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-19-200x77.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-19-400x153.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-19-800x306.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-19-1200x460.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-19.png 1757w\" sizes=\"(max-width: 611px) 100vw, 611px\" \/><figcaption id=\"caption-attachment-10441\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 2. Data type size and compiler<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">When you write a &#8216;C&#8217; program, you should give attention to all these details. There is a possibility of a portability issue in your &#8216;C&#8217; code due to the selection of data types.&nbsp;<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Let&#8217;s discuss portability issues in &#8220;C&#8221; programming code due to the &#8220;size of data types&#8221;.&nbsp;<\/span><\/p>\n<p class=\"\" style=\"font-size: 23px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"text-decoration: underline; color: #c43410;\"><b>Portability Issues in \u201cC\u201d programming code due to \u201csize of data types\u201d<\/b><\/span><\/p>\n<ul class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">In &#8216;C&#8217; programming language, the most commonly used data types <strong><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"http:\/\/fastbitlab.com\/integer-data-type-int-and-long\/\" target=\"_blank\" rel=\"noopener\">&#8220;int&#8221; and &#8220;long&#8221;<\/a><\/span><\/strong> cause portability issues.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">The reason is that the storage size for &#8216;int&#8217;, &#8216;long&#8217; type variable is not defined within the C standard(C90 or C99).&nbsp;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">The compiler vendors have the choice to define the storage size for the variable depending solely on hardware capabilities of the target platform, with respect to the minimum widths defined by the standard.<\/span><\/li>\n<\/ul>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">The standard only talks about minimum and maximum values. So, it doesn&#8217;t talk about fixing a certain amount of size for &#8216;int&#8217; or &#8216;long&#8217;.&nbsp;<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<figure id=\"attachment_10443\" aria-describedby=\"caption-attachment-10443\" style=\"width: 675px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-10443\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-3-15-1024x455.png\" alt=\"Importance of stdint.h\" width=\"675\" height=\"300\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-15-1024x455.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-15-300x133.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-15-768x341.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-15-600x266.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-15-1536x682.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-15-120x53.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-15-500x222.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-15-200x89.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-15-400x178.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-15-800x355.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-15-1200x533.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-15.png 1845w\" sizes=\"(max-width: 675px) 100vw, 675px\" \/><figcaption id=\"caption-attachment-10443\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 3. Integer Data Types<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">For example, in the xc8 compiler, why would&nbsp; xc8 compiler designers have selected 2 bytes for an int data type?&nbsp;&nbsp;<\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">The reason may be, According to the compiler designer keeping the size of the &#8220;int&#8221; type variable as 2 bytes will be the most efficient for data manipulation considering the underlying architecture of the PIC 8-bit microcontrollers. So, that may be the reason for that, and for ARM, it may not be true. That&#8217;s why ARM compiler designers have selected &#8220;int&#8221; as 4 bytes because that would give more speed and code size benefits.<\/span><span style=\"font-weight: 400;\">&nbsp;<\/span><\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Now, let&#8217;s take a look at the code snippet. <\/span><\/p>\n<figure id=\"attachment_10444\" aria-describedby=\"caption-attachment-10444\" style=\"width: 616px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10444\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-4-14-1024x460.png\" alt=\"Importance of stdint.h\" width=\"616\" height=\"277\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-14-1024x460.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-14-300x135.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-14-768x345.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-14-600x269.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-14-1536x689.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-14-120x54.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-14-500x224.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-14-200x90.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-14-400x179.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-14-800x359.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-14-1200x538.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-14.png 1785w\" sizes=\"(max-width: 616px) 100vw, 616px\" \/><figcaption id=\"caption-attachment-10444\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 4. Code snippet<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">Here, there is a variable called <\/span><b>count<\/b><span style=\"font-weight: 400;\">, and its data type is <\/span><b>unsigned int<\/b><span style=\"font-weight: 400;\">. And there is one conditional statement, that is If. If(count&gt;65,536), so inside the flower brackets(Do this task), that task will be done.&nbsp;<\/span><\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">If you check this If(count&gt;65,536) code, this code will cause portability issues, so when you change the compiler.&nbsp;<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Here, let&#8217;s say I use one compiler. I would call it compiler A, and the compiler treats the count variable as 4 bytes. When this count variable is of 4 bytes, then this If(count&gt;65,536) code will work fine, no problem.&nbsp;<\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">And when I use this If(count&gt;65,536) code under compiler B and let&#8217;s say if compiler B treats unsigned int as 2 bytes, then this(Do this task) task will never be executed. Because the maximum value for count is 65,535, and if you further increment this, the value goes back to 0 and starts over again.<\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">That&#8217;s why this code will become buggy on compiler B if it uses 2 bytes for the unsigned int. So, to get rid of these kinds of problems, you must stop using these standard data type names. So, instead, use the data type alias names given by the header file stdint.h.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 25px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 35px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"text-decoration: underline; color: #c43410;\"><b>stdint.h<\/b><\/span><\/p>\n<ul class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">The standard library header file stdint.h defines fixed-width integers using alias data types for the standard data types available in &#8216;C&#8217;.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">A fixed-width integer data type is an aliased data type that is based on the exact number of bits required to store the data.<\/span><\/li>\n<\/ul>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">For example, int8_t is an alias name for 8 bits signed data type. <\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">What is the 8 bits signed data type in &#8216;C&#8217;? <\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">It is a signed char or char. So, instead of using char, use int8_t. int8_t is actually an aliased name for the standard data type.<\/span><\/p>\n<figure id=\"attachment_10445\" aria-describedby=\"caption-attachment-10445\" style=\"width: 696px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10445 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-5-13-1024x548.png\" alt=\"Figure 5. Example\" width=\"696\" height=\"373\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-13-1024x548.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-13-300x161.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-13-768x411.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-13-600x321.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-13-1536x823.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-13-120x64.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-13-500x268.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-13-200x107.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-13-400x214.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-13-800x428.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-13-1200x643.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-13.png 1895w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><figcaption id=\"caption-attachment-10445\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 5. Example<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">Instead of using unsigned char, use uint8_t. Where &#8216;u&#8217; stands for unsigned. So, all these are aliased data type names for the standard data types managed by the stdint.h. How is it managed? you need not to worry about that. That will be resolved by the stdint.h. So, if you want, you can open and check the stdint.h file.&nbsp;<\/span><span style=\"font-weight: 400;\">&nbsp;<\/span><\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<figure id=\"attachment_10446\" aria-describedby=\"caption-attachment-10446\" style=\"width: 660px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10446\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-6-12-1024x441.png\" alt=\"Importance of stdint.h\" width=\"660\" height=\"284\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-12-1024x441.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-12-300x129.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-12-768x331.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-12-600x258.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-12-1536x662.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-12-120x52.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-12-500x215.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-12-200x86.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-12-400x172.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-12-800x345.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-12-1200x517.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-12.png 1869w\" sizes=\"(max-width: 660px) 100vw, 660px\" \/><figcaption id=\"caption-attachment-10446\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 6. Code snippet<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">So, if I use uint32_t instead of unsigned int, here it doesn&#8217;t matter under which compiler this code compiles; the compiler will always reserve 32 bits for the variable by using a suitable standard data type. So, that is guaranteed. That&#8217;s why you need not to worry about portability issues.&nbsp;<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Now, if you want to locate stdint.h or any standard library header file, you have to open the toolchain installation folder.<\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">For example, I have a Windows 64-bit machine, and if I want to compile a &#8216;C&#8217; program for my PC, I use a MinGW 64-bit toolchain. That is installed in the MinGW folder. If I go there, I will find the include folder. In the include folder, you see all standard library include files, as shown in Figure 7.<\/span><\/p>\n<figure id=\"attachment_10447\" aria-describedby=\"caption-attachment-10447\" style=\"width: 681px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10447\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-7-10-1024x662.png\" alt=\"Importance of stdint.h\" width=\"681\" height=\"440\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-10-1024x662.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-10-300x194.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-10-768x496.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-10-600x388.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-10-1536x993.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-10-120x78.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-10-500x323.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-10-200x129.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-10-400x258.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-10-800x517.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-10-1200x775.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-10.png 1583w\" sizes=\"(max-width: 681px) 100vw, 681px\" \/><figcaption id=\"caption-attachment-10447\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 7. standard library include files<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Open stdint.h file. <\/span><\/p>\n<figure id=\"attachment_10448\" aria-describedby=\"caption-attachment-10448\" style=\"width: 666px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10448\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-8-9-1024x547.png\" alt=\"Importance of stdint.h\" width=\"666\" height=\"356\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-9-1024x547.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-9-300x160.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-9-768x410.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-9-600x321.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-9-1536x821.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-9-120x64.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-9-500x267.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-9-200x107.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-9-400x214.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-9-800x427.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-9-1200x641.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-9.png 1915w\" sizes=\"(max-width: 666px) 100vw, 666px\" \/><figcaption id=\"caption-attachment-10448\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 8. stdint.h file<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Figure 8 shows a stdint.h file. Here int8_t, uint8_t, int16_t, uint16_t, like that, these are the aliased names you&#8217;ll use in your program. Signed char, unsigned char, short, unsigned short, int, unsigned, long long, unsigned long long are the aliased to standard data type names.&nbsp;<\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">How is it aliased? <\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">It is compiler dependent. Different compilers issue different stdint.h. So, the stdint.h contents will not be the same across different compilers.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">And the bin folder usually contains all the binaries(as shown in Figure 9), which are used during your code compilation.<\/span><\/p>\n<figure id=\"attachment_10449\" aria-describedby=\"caption-attachment-10449\" style=\"width: 705px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10449\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-9-7-1024x547.png\" alt=\"Importance of stdint.h\" width=\"705\" height=\"377\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-7-1024x547.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-7-300x160.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-7-768x410.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-7-600x321.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-7-1536x821.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-7-120x64.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-7-500x267.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-7-200x107.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-7-400x214.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-7-800x427.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-7-1200x641.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-7.png 1911w\" sizes=\"(max-width: 705px) 100vw, 705px\" \/><figcaption id=\"caption-attachment-10449\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 9. bin folder<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Let&#8217;s check the cross-compilation toolchain. Now let me check the cross-compilation toolchain for PIC microcontrollers. So, that also I have installed you can watch here.<\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">For example, I have a Microchip folder. Here are xc8 and xc32 compilers. These are used for code generation for PIC8 and PIC32 microcontrollers.<\/span><\/p>\n<figure id=\"attachment_10450\" aria-describedby=\"caption-attachment-10450\" style=\"width: 699px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10450\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-10-5-1024x405.png\" alt=\"Importance of stdint.h\" width=\"699\" height=\"277\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-10-5-1024x405.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-10-5-300x119.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-10-5-768x304.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-10-5-600x238.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-10-5-120x48.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-10-5-500x198.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-10-5-200x79.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-10-5-400x158.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-10-5-800x317.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-10-5.png 1192w\" sizes=\"(max-width: 699px) 100vw, 699px\" \/><figcaption id=\"caption-attachment-10450\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 10. Microchip folder<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Open the xc8 folder; if you go inside the bin folder, you see the xc8.exe application. So, this is a compiler xc8.&nbsp;<\/span><\/p>\n<figure id=\"attachment_10451\" aria-describedby=\"caption-attachment-10451\" style=\"width: 638px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10451 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-11-5-1024x469.png\" alt=\"Figure 11. xc8 compiler\" width=\"638\" height=\"292\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-11-5-1024x469.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-11-5-300x137.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-11-5-768x352.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-11-5-600x275.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-11-5-120x55.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-11-5-500x229.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-11-5-200x92.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-11-5-400x183.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-11-5-800x367.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-11-5-1200x550.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-11-5.png 1244w\" sizes=\"(max-width: 638px) 100vw, 638px\" \/><figcaption id=\"caption-attachment-10451\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 11. xc8 compiler<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">And in the xc8 folder, you will find a folder called <\/span><b>pic<\/b><span style=\"font-weight: 400;\"><span style=\"color: #000000;\">. Here, go to the include folder(here you will find different standards); let&#8217;s go inside c99, and here you will find all the standard library header files, as shown in Figure 12.<\/span> <\/span><\/span><\/p>\n<figure id=\"attachment_10452\" aria-describedby=\"caption-attachment-10452\" style=\"width: 689px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10452 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-12-5-1024x669.png\" alt=\"Figure 12. Standard library header files\" width=\"689\" height=\"450\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-12-5-1024x669.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-12-5-300x196.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-12-5-768x502.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-12-5-600x392.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-12-5-120x78.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-12-5-500x327.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-12-5-200x131.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-12-5-400x261.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-12-5-800x523.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-12-5-1200x784.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-12-5.png 1511w\" sizes=\"(max-width: 689px) 100vw, 689px\" \/><figcaption id=\"caption-attachment-10452\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 12. Standard library header files<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Open the stdint.h file. So, you can see that the content of this file is different compared to the earlier one(Figure 8). That is for MinGW, this is for xc8, so here the implementation will be different. But you still get the same aliased names like int8_t, int16_t, int32_t, uint8_t,uint16_t, etc.<\/span><\/p>\n<figure id=\"attachment_10453\" aria-describedby=\"caption-attachment-10453\" style=\"width: 635px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10453\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-13-4-1024x594.png\" alt=\"Importance of stdint.h\" width=\"635\" height=\"368\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-13-4-1024x594.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-13-4-300x174.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-13-4-768x446.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-13-4-600x348.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-13-4-1536x891.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-13-4-120x70.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-13-4-500x290.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-13-4-200x116.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-13-4-400x232.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-13-4-800x464.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-13-4-1200x696.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-13-4.png 1753w\" sizes=\"(max-width: 635px) 100vw, 635px\" \/><figcaption id=\"caption-attachment-10453\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 13. Stdint.h file<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Let&#8217;s check the cross-toolchain for our STM32 microcontroller, which is based on the ARM processor installed here in the ST folder. Go to the STM32CubeIDE folder, and go to Plugins. So, let&#8217;s open the gnu-arm-embedded toolchain here, as shown in Figure 14.<\/span><\/p>\n<figure id=\"attachment_10454\" aria-describedby=\"caption-attachment-10454\" style=\"width: 688px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10454 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-14-3-1024x590.png\" alt=\"Figure 14. Inside Plugins folder\" width=\"688\" height=\"396\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-14-3-1024x590.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-14-3-300x173.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-14-3-768x442.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-14-3-600x345.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-14-3-1536x884.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-14-3-120x69.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-14-3-500x288.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-14-3-200x115.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-14-3-400x230.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-14-3-800x461.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-14-3-1200x691.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-14-3.png 1721w\" sizes=\"(max-width: 688px) 100vw, 688px\" \/><figcaption id=\"caption-attachment-10454\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 14. Inside Plugins folder<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">And then go to tools, arm-none-eabi, and include folder. Open the include folder; here, you will find all the standard library header files, as shown in Figure 15. <\/span><\/p>\n<figure id=\"attachment_10455\" aria-describedby=\"caption-attachment-10455\" style=\"width: 713px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10455 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-15-4-1024x567.png\" alt=\"Figure 15. Standard library header files\" width=\"713\" height=\"395\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-15-4-1024x567.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-15-4-300x166.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-15-4-768x425.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-15-4-600x332.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-15-4-1536x851.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-15-4-120x66.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-15-4-500x277.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-15-4-200x111.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-15-4-400x222.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-15-4-800x443.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-15-4-1200x665.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-15-4.png 1847w\" sizes=\"(max-width: 713px) 100vw, 713px\" \/><figcaption id=\"caption-attachment-10455\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 15. Standard library header files<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Let\u2019s open the stdint.h. The implementation may be different, but as I said, you will still see various alias names(Figure 16).<\/span><\/p>\n<figure id=\"attachment_10457\" aria-describedby=\"caption-attachment-10457\" style=\"width: 662px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10457 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-16-4-1024x554.png\" alt=\"Figure 16. Stdint.h file\" width=\"662\" height=\"358\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-16-4-1024x554.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-16-4-300x162.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-16-4-768x415.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-16-4-600x324.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-16-4-1536x831.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-16-4-120x65.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-16-4-500x270.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-16-4-200x108.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-16-4-400x216.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-16-4-800x433.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-16-4-1200x649.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-16-4.png 1877w\" sizes=\"(max-width: 662px) 100vw, 662px\" \/><figcaption id=\"caption-attachment-10457\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 16. Stdint.h file<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">I would like to introduce some of the useful stdint.h alias names apart from what I mentioned before like int8, uint8, int32, uint32, etc.&nbsp;<\/span><\/p>\n<p class=\"\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 25px; line-height: 35px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"text-decoration: underline; color: #c43410;\"><b>Some useful stdint.h aliases while programming<\/b><\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"color: #000080;\"><b>uintmax_t:<\/b><\/span><span style=\"font-weight: 400;\"> defines the largest fixed-width unsigned integer possible on the system. So, you need not worry whether it is 16 or 32, or 64 bits; just use uintmax_t.<\/span><\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"color: #000080;\"><b>intmax_t:<\/b><\/span><span style=\"font-weight: 400;\"> defines the largest fixed-width signed integer possible on the system.<\/span><\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"color: #000080;\"><b>uintptr_t:<\/b><\/span><span style=\"font-weight: 400;\"> defines an unsigned integer type that is wide enough to store the value of a pointer. For example, for our 64-bit machine, the size of the pointer is 64 bits(8 bytes). So, when you are coding for some unknown architecture like PIC architecture or ARM architecture, you need not worry about the pointer size, so you just use uintptr_t.<\/span><\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 1.8em; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">From this article onwards, we will be using the stdint.h header file and its various alias names, and in the following article, I will cover<span style=\"color: #ff6600;\"> <a style=\"color: #ff6600; text-decoration: underline;\" href=\"http:\/\/fastbitlab.com\/operators-in-c\/\" target=\"_blank\" rel=\"noopener\"><strong>operators in &#8216;C<\/strong>&#8216;<\/a><\/span>.&nbsp;<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 20px; border-width: 0px; line-height: 26px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><b>FastBit Embedded Brain Academy Courses<\/b><\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px;\"><span style=\"color: #000000;\">C<span style=\"font-weight: 400;\"><span style=\"color: #000000;\">lick here:<\/span>&nbsp;<\/span><\/span><span style=\"color: #0000ff;\"><a style=\"color: #0000ff; text-decoration: underline;\" href=\"http:\/\/fastbitlab.com\/course1\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">https:\/\/fastbitlab.com\/course1<\/span><\/a><\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Importance of &lt;stdint.h&gt; &nbsp; &nbsp; In this article, let&#8217;s learn about the importance of &lt;stdint.h&gt;. &lt;stdint.h&gt; is one of the standard library header file. &nbsp; Let&#8217;s say you have written a &#8216;C&#8217; program, keeping in mind certain data types and its associated sizes. Now, let\u2019s say tomorrow you change the compiler; when you change [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":10445,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[],"footnotes":""},"categories":[8],"tags":[16],"class_list":["post-10437","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-microcontroller-embedded-c-programming","entry","has-media"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Importance of stdint.h - Integer types |Microcontroller Embedded C<\/title>\n<meta name=\"description\" content=\"Importance of stdint.h. The standard library header file stdint.h defines fixed-width integers using alias data types for the standard\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Importance of stdint.h - Integer types |Microcontroller Embedded C\" \/>\n<meta property=\"og:description\" content=\"Importance of stdint.h. The standard library header file stdint.h defines fixed-width integers using alias data types for the standard\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\/\" \/>\n<meta property=\"og:site_name\" content=\"FastBit EBA\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/fastbiteba\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-16T04:19:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-10T11:10:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-13.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1895\" \/>\n\t<meta property=\"og:image:height\" content=\"1015\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"FastBitLab\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fastbiteba\" \/>\n<meta name=\"twitter:site\" content=\"@fastbiteba\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"FastBitLab\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\\\/\"},\"author\":{\"name\":\"FastBitLab\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/person\\\/e32b38e733a0d76ffa7e6bc998652e5d\"},\"headline\":\"Microcontroller Embedded C Programming Lecture 77| Importance of stdint.h\",\"datePublished\":\"2022-07-16T04:19:34+00:00\",\"dateModified\":\"2023-02-10T11:10:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\\\/\"},\"wordCount\":1690,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/Figure-5-13.png\",\"keywords\":[\"Microcontroller Embedded C programming Lectures\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\\\/\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\\\/\",\"name\":\"Importance of stdint.h - Integer types |Microcontroller Embedded C\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/Figure-5-13.png\",\"datePublished\":\"2022-07-16T04:19:34+00:00\",\"dateModified\":\"2023-02-10T11:10:13+00:00\",\"description\":\"Importance of stdint.h. The standard library header file stdint.h defines fixed-width integers using alias data types for the standard\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\\\/#primaryimage\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/Figure-5-13.png\",\"contentUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/Figure-5-13.png\",\"width\":1895,\"height\":1015,\"caption\":\"Figure 5. Example\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Microcontroller Embedded C Programming Lecture 77| Importance of stdint.h\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\",\"name\":\"FastBit EBA\",\"description\":\"Your Online Academy of Embedded Systems\",\"publisher\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\",\"name\":\"FastBit EBA\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/logo-EzNrEnyr.png\",\"contentUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/logo-EzNrEnyr.png\",\"width\":640,\"height\":640,\"caption\":\"FastBit EBA\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/fastbiteba\\\/\",\"https:\\\/\\\/x.com\\\/fastbiteba\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/fastbit-embedded-brain-academy-b3167b124\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCa1REBV9hyrzGp2mjJCagBg\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/person\\\/e32b38e733a0d76ffa7e6bc998652e5d\",\"name\":\"FastBitLab\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"caption\":\"FastBitLab\"},\"description\":\"The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Importance of stdint.h - Integer types |Microcontroller Embedded C","description":"Importance of stdint.h. The standard library header file stdint.h defines fixed-width integers using alias data types for the standard","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\/","og_locale":"en_US","og_type":"article","og_title":"Importance of stdint.h - Integer types |Microcontroller Embedded C","og_description":"Importance of stdint.h. The standard library header file stdint.h defines fixed-width integers using alias data types for the standard","og_url":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\/","og_site_name":"FastBit EBA","article_publisher":"https:\/\/www.facebook.com\/fastbiteba\/","article_published_time":"2022-07-16T04:19:34+00:00","article_modified_time":"2023-02-10T11:10:13+00:00","og_image":[{"width":1895,"height":1015,"url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-13.png","type":"image\/png"}],"author":"FastBitLab","twitter_card":"summary_large_image","twitter_creator":"@fastbiteba","twitter_site":"@fastbiteba","twitter_misc":{"Written by":"FastBitLab","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\/#article","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\/"},"author":{"name":"FastBitLab","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/person\/e32b38e733a0d76ffa7e6bc998652e5d"},"headline":"Microcontroller Embedded C Programming Lecture 77| Importance of stdint.h","datePublished":"2022-07-16T04:19:34+00:00","dateModified":"2023-02-10T11:10:13+00:00","mainEntityOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\/"},"wordCount":1690,"commentCount":2,"publisher":{"@id":"https:\/\/fastbitlab.com\/blog\/#organization"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-13.png","keywords":["Microcontroller Embedded C programming Lectures"],"articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\/","url":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\/","name":"Importance of stdint.h - Integer types |Microcontroller Embedded C","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\/#primaryimage"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-13.png","datePublished":"2022-07-16T04:19:34+00:00","dateModified":"2023-02-10T11:10:13+00:00","description":"Importance of stdint.h. The standard library header file stdint.h defines fixed-width integers using alias data types for the standard","breadcrumb":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\/#primaryimage","url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-13.png","contentUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-13.png","width":1895,"height":1015,"caption":"Figure 5. Example"},{"@type":"BreadcrumbList","@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-77-importance-of-stdint-h\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fastbitlab.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Microcontroller Embedded C Programming Lecture 77| Importance of stdint.h"}]},{"@type":"WebSite","@id":"https:\/\/fastbitlab.com\/blog\/#website","url":"https:\/\/fastbitlab.com\/blog\/","name":"FastBit EBA","description":"Your Online Academy of Embedded Systems","publisher":{"@id":"https:\/\/fastbitlab.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fastbitlab.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fastbitlab.com\/blog\/#organization","name":"FastBit EBA","url":"https:\/\/fastbitlab.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2026\/04\/logo-EzNrEnyr.png","contentUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2026\/04\/logo-EzNrEnyr.png","width":640,"height":640,"caption":"FastBit EBA"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/fastbiteba\/","https:\/\/x.com\/fastbiteba","https:\/\/www.linkedin.com\/in\/fastbit-embedded-brain-academy-b3167b124\/","https:\/\/www.youtube.com\/channel\/UCa1REBV9hyrzGp2mjJCagBg"]},{"@type":"Person","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/person\/e32b38e733a0d76ffa7e6bc998652e5d","name":"FastBitLab","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","caption":"FastBitLab"},"description":"The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries."}]}},"_links":{"self":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/10437","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/comments?post=10437"}],"version-history":[{"count":5,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/10437\/revisions"}],"predecessor-version":[{"id":13951,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/10437\/revisions\/13951"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media\/10445"}],"wp:attachment":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media?parent=10437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/categories?post=10437"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/tags?post=10437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}