{"id":10375,"date":"2022-07-14T04:10:08","date_gmt":"2022-07-14T04:10:08","guid":{"rendered":"http:\/\/fastbitlab.com\/?p=10375"},"modified":"2023-08-26T11:46:02","modified_gmt":"2023-08-26T06:16:02","slug":"microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization","status":"publish","type":"post","link":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\/","title":{"rendered":"Microcontroller Embedded C Programming Lecture 73| Pointer variables and initialization"},"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: 31px; border-width: 0px; line-height: 50px;\"><span style=\"color: #000080;\"><strong>Pointer variables and initialization<\/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=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">In this article, let\u2019s learn about Pointer variables and initialization. You learned about pointer variables and pointer data types in the<\/span> <span style=\"color: #800080;\"><a style=\"color: #800080; text-decoration: underline;\" href=\"http:\/\/fastbitlab.com\/microcontroller-embedded-c-programming-lecture-72-pointer-variables-and-pointer-data-types\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">previous<\/span><\/a><\/span><span style=\"font-weight: 400;\"> article.&nbsp;<\/span><\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">And there we did <\/span><b>char* address1 = (char*) 0x00007FFF8E3C3824;<\/b><span style=\"font-weight: 400;\"> something like this, as shown in Figure 1.<\/span><\/span><\/p>\n<figure id=\"attachment_10378\" aria-describedby=\"caption-attachment-10378\" style=\"width: 714px\" class=\"wp-caption aligncenter\"><img fetchpriority=\"high\" decoding=\"async\" class=\"wp-image-10378 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-1-18-1024x433.png\" alt=\"Figure 1. Pointer variable and initialization\" width=\"714\" height=\"302\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-18-1024x433.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-18-300x127.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-18-768x325.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-18-600x254.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-18-1536x650.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-18-120x51.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-18-500x212.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-18-200x85.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-18-400x169.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-18-800x339.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-18-1200x508.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-18.png 1803w\" sizes=\"(max-width: 714px) 100vw, 714px\" \/><figcaption id=\"caption-attachment-10378\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 1. Pointer variable and initialization<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">Here, address1 is called a pointer variable of type char*. <\/span><span style=\"font-weight: 400;\">&nbsp;<\/span><\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Let&#8217;s understand more about the address1 variable definition. So, when the compiler sees this definition, the compiler allocates 8 bytes for this address1 variable to store this(0x00007FFF8E3C3824) pointer, as shown in Figure 2.<\/span><\/p>\n<figure id=\"attachment_10379\" aria-describedby=\"caption-attachment-10379\" style=\"width: 706px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-10379 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-2-15-1024x514.png\" alt=\"Figure 2. Pointer variable definition and initialization\" width=\"706\" height=\"355\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-15-1024x514.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-15-300x151.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-15-768x385.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-15-600x301.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-15-1536x771.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-15-120x60.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-15-500x251.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-15-540x272.png 540w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-15-200x100.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-15-400x201.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-15-800x402.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-15-1200x602.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-15.png 1855w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><figcaption id=\"caption-attachment-10379\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 2. Pointer variable definition and initialization<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<figure id=\"attachment_10380\" aria-describedby=\"caption-attachment-10380\" style=\"width: 715px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-10380 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-3-11-1024x457.png\" alt=\"Figure 3. Pointer variable creation and initialization\" width=\"715\" height=\"319\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-11-1024x457.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-11-300x134.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-11-768x342.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-11-600x268.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-11-1536x685.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-11-120x54.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-11-500x223.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-11-200x89.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-11-400x178.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-11-800x357.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-11-1200x535.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-11.png 1884w\" sizes=\"(max-width: 715px) 100vw, 715px\" \/><figcaption id=\"caption-attachment-10380\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 3. Pointer variable creation and initialization<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">When the pointer variable is created, in our case the pointer variable is<\/span><b> address1<\/b><span style=\"font-weight: 400;\">. So, when it is created, 8 bytes of memory will be reserved for this variable. Why? Because in a 64-bit machine, a pointer size is 8 bytes. That&#8217;s why irrespective of the pointer variable type, the compiler will reserve 8 bytes of memory to store a pointer.<\/span><\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">And the initialized pointer is actually stored inside the variable. The address of the pointer variable and the pointer stored in a pointer variable is shown in Figure 3. And that pointer is nothing but one of the computer&#8217;s memory locations (0x00007FFF8E3C3824), and it may have some value(01000001).&nbsp;<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<figure id=\"attachment_10382\" aria-describedby=\"caption-attachment-10382\" style=\"width: 711px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10382\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-4-10-1024x458.png\" alt=\"Figure 4. Pointer variable creation\" width=\"711\" height=\"318\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-10-1024x458.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-10-300x134.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-10-768x343.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-10-600x268.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-10-1536x687.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-10-120x54.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-10-500x224.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-10-200x89.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-10-400x179.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-10-800x358.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-10-1200x536.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-10.png 1859w\" sizes=\"(max-width: 711px) 100vw, 711px\" \/><figcaption id=\"caption-attachment-10382\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 4. Pointer variable creation and initialization<\/span><\/figcaption><\/figure>\n<p class=\"\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Briefly, you can visualize something like this. address1 is a created pointer variable and it is initialized to the pointer 0x00007FFF8E3C3824, and 0x1F007FFF8E3C4821 is the address of this address1 variable. And that pointer may be pointing to some data in the computer memory, like 0x85, as shown in Figure 4. So, you can visualize something like this.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<figure id=\"attachment_10383\" aria-describedby=\"caption-attachment-10383\" style=\"width: 709px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10383\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-5-10-1024x415.png\" alt=\"Figure 5. Pointer variable definition and initialization\" width=\"709\" height=\"287\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-10-1024x415.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-10-300x122.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-10-768x311.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-10-600x243.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-10-1536x623.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-10-120x49.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-10-500x203.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-10-669x272.png 669w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-10-200x81.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-10-400x162.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-10-800x324.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-10-1200x487.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-10.png 1857w\" sizes=\"(max-width: 709px) 100vw, 709px\" \/><figcaption id=\"caption-attachment-10383\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 5. Pointer variable definition and initialization<\/span><\/figcaption><\/figure>\n<p class=\"\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">So, it doesn&#8217;t matter which pointer data type you use for the pointer variable. The compiler will always reserve <\/span><b>8 bytes<\/b><span style=\"font-weight: 400;\"> for the pointer variable irrespective of their pointer data type. It doesn&#8217;t matter whether you use char*, int*, or long long int*. So, the compiler will always reserve 8 bytes in this case because our machine architecture is actually 64-bit.&nbsp;<\/span><\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">In other words, the pointer data type doesn&#8217;t control the memory size of the pointer variable.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">Then, what is the purpose of mentioning &#8220;pointer data type&#8221;? Why do we have to mention this<\/span><span style=\"font-weight: 400;\">?<\/span><\/span><\/p>\n<figure id=\"attachment_10384\" aria-describedby=\"caption-attachment-10384\" style=\"width: 715px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10384\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-6-9-1024x388.png\" alt=\"Pointer variable and initialization\" width=\"715\" height=\"271\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-9-1024x388.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-9-300x114.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-9-768x291.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-9-600x227.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-9-1536x581.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-9-120x45.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-9-500x189.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-9-200x76.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-9-400x151.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-9-800x303.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-9-1200x454.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-9.png 1831w\" sizes=\"(max-width: 715px) 100vw, 715px\" \/><figcaption id=\"caption-attachment-10384\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 6. Pointer variable definition and initialization<\/span><\/figcaption><\/figure>\n<p class=\"\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">In a normal variable definition, when I write <\/span><b>char temp = 30;<\/b><span style=\"font-weight: 400;\"> Here, the compiler reserves 1 byte for the temp variable to store this value 30. But that is not the case in the pointer variable definition. So, irrespective of the pointer data type always 8 bytes will be reserved for the variable.&nbsp;<\/span><\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">What is the purpose of mentioning the &#8220;pointer data type&#8221;? Let&#8217;s see why.<\/span><span style=\"font-weight: 400;\">&nbsp;<\/span><\/span><\/p>\n<figure id=\"attachment_10385\" aria-describedby=\"caption-attachment-10385\" style=\"width: 709px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10385\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-7-9-1024x504.png\" alt=\"Figure 7. Pointer variable definition\" width=\"709\" height=\"349\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-9-1024x504.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-9-300x148.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-9-768x378.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-9-600x296.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-9-1536x757.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-9-120x59.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-9-500x246.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-9-200x99.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-9-400x197.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-9-800x394.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-9-1200x591.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-9.png 1829w\" sizes=\"(max-width: 709px) 100vw, 709px\" \/><figcaption id=\"caption-attachment-10385\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 7. Pointer variable definition and initialization<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">The pointer data type decides the behavior of the operations carried out on the pointer variable. The operations are read, write, increment, decrement, and so on.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Basically, this char* pointer datatype is used to control the behavior of the operations that you perform on the address1 pointer variable.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<figure id=\"attachment_10387\" aria-describedby=\"caption-attachment-10387\" style=\"width: 709px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10387\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-8-8-1024x459.png\" alt=\"Figure 8. Pointer variable definitions\" width=\"709\" height=\"318\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-8-1024x459.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-8-300x134.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-8-768x344.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-8-600x269.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-8-1536x689.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-8-120x54.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-8-500x224.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-8-200x90.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-8-400x179.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-8-800x359.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-8-1200x538.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-8.png 1867w\" sizes=\"(max-width: 709px) 100vw, 709px\" \/><figcaption id=\"caption-attachment-10387\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 8. Pointer variable definitions<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Here are a couple of pointer variable definitions by using different pointer datatypes. Let&#8217;s consider the first statement. So, here a pointer variable is defined using char* pointer datatype. The meaning of this variable definition is when the read operation is performed on the address1, then the read operation yields 1 byte of data out of this pointer. So, this actually decides how many bytes of data can be read from this pointer when the read operation is performed.&nbsp;<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">The same thing applies to write operation, increment operation, decrement operation.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">If you consider the second definition, when the read operation on this pointer variable is performed, the operation is going to yield 4 bytes of data out of this pointer.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">In the third definition, the read operation on the address1 variable, in this case, yields 8 bytes of data.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<figure id=\"attachment_10389\" aria-describedby=\"caption-attachment-10389\" style=\"width: 710px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10389\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-9-6-1024x541.png\" alt=\"Figure 9. Pointer variable definitions\" width=\"710\" height=\"375\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-6-1024x541.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-6-300x158.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-6-768x406.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-6-600x317.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-6-1536x811.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-6-120x63.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-6-500x264.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-6-200x106.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-6-400x211.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-6-800x423.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-6-1200x634.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-6.png 1819w\" sizes=\"(max-width: 710px) 100vw, 710px\" \/><figcaption id=\"caption-attachment-10389\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 9. Pointer variable definitions<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">That&#8217;s why, in the first definition, the address1 variable is also called a pointer variable to char type data or pointer variable to 1 byte data.&nbsp;<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">In the second definition, the address1 variable is also called a pointer variable to int type data or 4 bytes data.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\"><span style=\"color: #000000;\">And in the third definition, the address1 variable is also called a pointer variable to long long int type data.<\/span>&nbsp;<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-size: 20px; line-height: 25px; 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=\"border-width: 0px; font-size: 17px;\"><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; Pointer variables and initialization &nbsp; &nbsp; In this article, let\u2019s learn about Pointer variables and initialization. You learned about pointer variables and pointer data types in the previous article.&nbsp; And there we did char* address1 = (char*) 0x00007FFF8E3C3824; something like this, as shown in Figure 1. &nbsp; Here, address1 is called a pointer variable [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":10380,"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-10375","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>Pointer Variables and Initialization in C Programming<\/title>\n<meta name=\"description\" content=\"Pointer variables and initialization. Understand how pointer data types affect memory allocation and variable behavior through detailed\" \/>\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-73-pointer-variables-and-initialization\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Pointer Variables and Initialization in C Programming\" \/>\n<meta property=\"og:description\" content=\"Pointer variables and initialization. Understand how pointer data types affect memory allocation and variable behavior through detailed\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\/\" \/>\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-14T04:10:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-26T06:16:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-11.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1884\" \/>\n\t<meta property=\"og:image:height\" content=\"840\" \/>\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=\"6 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-73-pointer-variables-and-initialization\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\\\/\"},\"author\":{\"name\":\"FastBitLab\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/person\\\/e32b38e733a0d76ffa7e6bc998652e5d\"},\"headline\":\"Microcontroller Embedded C Programming Lecture 73| Pointer variables and initialization\",\"datePublished\":\"2022-07-14T04:10:08+00:00\",\"dateModified\":\"2023-08-26T06:16:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\\\/\"},\"wordCount\":842,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/Figure-3-11.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-73-pointer-variables-and-initialization\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\\\/\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\\\/\",\"name\":\"Pointer Variables and Initialization in C Programming\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/Figure-3-11.png\",\"datePublished\":\"2022-07-14T04:10:08+00:00\",\"dateModified\":\"2023-08-26T06:16:02+00:00\",\"description\":\"Pointer variables and initialization. Understand how pointer data types affect memory allocation and variable behavior through detailed\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\\\/#primaryimage\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/Figure-3-11.png\",\"contentUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/Figure-3-11.png\",\"width\":1884,\"height\":840,\"caption\":\"Figure 3. Pointer variable creation and initialization\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Microcontroller Embedded C Programming Lecture 73| Pointer variables and initialization\"}]},{\"@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":"Pointer Variables and Initialization in C Programming","description":"Pointer variables and initialization. Understand how pointer data types affect memory allocation and variable behavior through detailed","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-73-pointer-variables-and-initialization\/","og_locale":"en_US","og_type":"article","og_title":"Pointer Variables and Initialization in C Programming","og_description":"Pointer variables and initialization. Understand how pointer data types affect memory allocation and variable behavior through detailed","og_url":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\/","og_site_name":"FastBit EBA","article_publisher":"https:\/\/www.facebook.com\/fastbiteba\/","article_published_time":"2022-07-14T04:10:08+00:00","article_modified_time":"2023-08-26T06:16:02+00:00","og_image":[{"width":1884,"height":840,"url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-11.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":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\/#article","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\/"},"author":{"name":"FastBitLab","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/person\/e32b38e733a0d76ffa7e6bc998652e5d"},"headline":"Microcontroller Embedded C Programming Lecture 73| Pointer variables and initialization","datePublished":"2022-07-14T04:10:08+00:00","dateModified":"2023-08-26T06:16:02+00:00","mainEntityOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\/"},"wordCount":842,"commentCount":0,"publisher":{"@id":"https:\/\/fastbitlab.com\/blog\/#organization"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-11.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-73-pointer-variables-and-initialization\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\/","url":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\/","name":"Pointer Variables and Initialization in C Programming","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\/#primaryimage"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-11.png","datePublished":"2022-07-14T04:10:08+00:00","dateModified":"2023-08-26T06:16:02+00:00","description":"Pointer variables and initialization. Understand how pointer data types affect memory allocation and variable behavior through detailed","breadcrumb":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\/#primaryimage","url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-11.png","contentUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-11.png","width":1884,"height":840,"caption":"Figure 3. Pointer variable creation and initialization"},{"@type":"BreadcrumbList","@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-73-pointer-variables-and-initialization\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fastbitlab.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Microcontroller Embedded C Programming Lecture 73| Pointer variables and initialization"}]},{"@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\/10375","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=10375"}],"version-history":[{"count":5,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/10375\/revisions"}],"predecessor-version":[{"id":15617,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/10375\/revisions\/15617"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media\/10380"}],"wp:attachment":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media?parent=10375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/categories?post=10375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/tags?post=10375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}