

{"id":59044,"date":"2019-06-13T14:23:57","date_gmt":"2019-06-13T08:53:57","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=59044"},"modified":"2019-06-20T10:29:52","modified_gmt":"2019-06-20T04:59:52","slug":"bit-fields-in-c","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/bit-fields-in-c\/","title":{"rendered":"Bit Fields in C &#8211; An Unrecognised Concept Omitted by C Aspirants"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:1509,&quot;href&quot;:&quot;https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Bit_field&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20251011074322\\\/https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Bit_field&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-09 09:42:52&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-12 14:15:31&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-22 05:50:23&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-28 14:33:15&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-07 13:29:48&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-12 12:18:39&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-15 22:06:52&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-19 12:13:26&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-06 07:02:20&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-09 18:26:12&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-14 06:14:25&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-18 04:31:38&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-22 20:40:16&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-28 00:16:30&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-05 12:55:55&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-15 12:42:32&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-29 02:00:40&quot;,&quot;http_code&quot;:429},{&quot;date&quot;:&quot;2026-04-01 10:26:11&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-16 06:17:44&quot;,&quot;http_code&quot;:429},{&quot;date&quot;:&quot;2026-04-21 11:18:21&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-02 23:13:40&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-10 21:21:13&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-15 21:50:48&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-27 10:36:55&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-05-27 10:36:55&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;}]'><\/div>\n<p><em>Bit fields in C are relatively very simple than all the topics we have covered so far. A bit field is simply a data structure that helps the user to allocate memory to structures and unions<\/em>.<\/p>\n<p>In this tutorial, we will discuss:<\/p>\n<ul>\n<li>Need for Bit Fields<\/li>\n<li>Declaration\u00a0 of Bit Fields<\/li>\n<li>Working of Bit Fields<\/li>\n<\/ul>\n<p><em><strong>In order to understand bit fields, we need to have a clear understanding of Structures and <a href=\"https:\/\/data-flair.training\/blogs\/union-in-c-language\/\">Unions in C<\/a>.<\/strong><\/em><\/p>\n<h2>Bit Fields in C Language<\/h2>\n<p>In programming terminology, <em>a bit field is a data structure that allows the programmer to allocate memory to structures and unions in bits in order to utilize computer memory in an efficient manner<\/em>.<\/p>\n<p>Since structures and unions are user-defined <a href=\"https:\/\/data-flair.training\/blogs\/data-types-in-c\/\"><strong><em>data types in C<\/em><\/strong><\/a>, the user has an idea of how much memory will they occupy. Accordingly, by the implementation of bit fields, memory management becomes easy and efficient.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Bit-Fields-in-C-Language.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-60022\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Bit-Fields-in-C-Language.jpg\" alt=\"Bit Fields in C Language\" width=\"802\" height=\"420\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Bit-Fields-in-C-Language.jpg 802w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Bit-Fields-in-C-Language-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Bit-Fields-in-C-Language-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Bit-Fields-in-C-Language-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Bit-Fields-in-C-Language-520x272.jpg 520w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><\/a><\/p>\n<h2>Need for Bit Fields in C<\/h2>\n<p>Bit fields are of great significance in C programming, because of the following reasons:<\/p>\n<ul>\n<li>Used to reduce memory consumption.<\/li>\n<li>Easy to implement.<\/li>\n<li>Provides flexibility to the code.<\/li>\n<\/ul>\n<p><strong>Declaration of Bit Fields in C<\/strong><\/p>\n<p>A bit field is pretty easy to declare. Its declaration is as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">struct\r\n{\r\ndata_type variable_name : size_in_bits;\r\n};<\/pre>\n<p><em>The formal name for <strong>size_in_bits<\/strong> is called the width of the bit field.<\/em><\/p>\n<h2>How do Bit Fields in C works?<\/h2>\n<p>In order to understand how bit fields work, let us consider a problem, in which we are expected to define a structured time to display the time according to 24-hour clock entered by the user with unsigned int hours, minutes and seconds.<\/p>\n<p>Since an unsigned integer occupies 4 bytes of memory according to a 64-bit compiler, the size of the structure would be 12 bytes.<\/p>\n<p>Here is a code in C that illustrates the implementation of a structured time without the use of bit fields:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">#include &lt;stdio.h&gt;\r\nstruct time\r\n{\r\nunsigned int hours;\r\nunsigned int minutes;\r\nunsigned int seconds;\r\n}; \r\nint main()\r\n{\r\n\r\nstruct time t = {11, 30, 10}; \/\/ Here t is an object of the structure time\r\nprintf(\"Welcome to DataFlair tutorials!\\n\\n\");\r\nprintf(\"The time is %d : %d : %d\\n\", t.hours, t.minutes, t.seconds);\r\nprintf(\"The size of time is %ld bytes.\\n\", sizeof(struct time));\r\nreturn 0; \r\n}<\/pre>\n<p>Clearly, we know that, for a 24-hour clock, the range of hours should be from 0 to 23, minutes, and seconds should be from 0 to 59.<\/p>\n<p><strong>Code on Screen<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/How-bit-fields-in-C-works.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-59051 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/How-bit-fields-in-C-works.jpg\" alt=\"How bit fields in C works\" width=\"1303\" height=\"687\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/How-bit-fields-in-C-works.jpg 1303w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/How-bit-fields-in-C-works-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/How-bit-fields-in-C-works-300x158.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/How-bit-fields-in-C-works-768x405.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/How-bit-fields-in-C-works-1024x540.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/How-bit-fields-in-C-works-520x274.jpg 520w\" sizes=\"auto, (max-width: 1303px) 100vw, 1303px\" \/><\/a><\/p>\n<p><strong>Output<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Bit-fields-in-C.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-59052 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Bit-fields-in-C.jpg\" alt=\"Output of Bit fields in C\" width=\"1301\" height=\"669\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Bit-fields-in-C.jpg 1301w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Bit-fields-in-C-150x77.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Bit-fields-in-C-300x154.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Bit-fields-in-C-768x395.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Bit-fields-in-C-1024x527.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Bit-fields-in-C-520x267.jpg 520w\" sizes=\"auto, (max-width: 1301px) 100vw, 1301px\" \/><\/a><\/p>\n<p>Therefore, by the implementation of <a href=\"https:\/\/en.wikipedia.org\/wiki\/Bit_field\">bit fields<\/a>, we can restrict their sizes.<\/p>\n<ul>\n<li><strong>Hours:<\/strong> Since the range is from 0-23, we consider 5 bits as 25 = 32 which is the nearest larger bit than the upper limit. If we consider 4 bits, then 24 = 16 would be smaller than the upper limit.<\/li>\n<li><strong>Minutes and seconds:<\/strong> Since the range is from 0-59, we consider 6 bits as 26 = 64 which is the nearest larger bit than the upper limit. If we consider 5 bits, then 25 = 32 would be smaller than the upper limit.<\/li>\n<\/ul>\n<p>Here is a code in C that illustrates the use of bit-fields with the help of the previous example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">#include &lt;stdio.h&gt;\r\nstruct time\r\n{\r\nunsigned int hours: 5; \/\/ Size restricted to 5 bits\r\nunsigned int minutes:6; \/\/ Size restricted to 6 bits\r\nunsigned int seconds:6; \/\/ Size restricted to 6 bits\r\n}; \r\nint main()\r\n{\r\n\r\nstruct time t = {11, 30, 10}; \/\/ Here t is an object of the structure time\r\nprintf(\"Welcome to DataFlair tutorials!\\n\\n\");\r\nprintf(\"The time is %d : %d : %d\\n\", t.hours, t.minutes, t.seconds);\r\nprintf(\"The size of time is %ld bytes.\\n\", sizeof(struct time));\r\nreturn 0; \r\n}<\/pre>\n<p>It is important to note that in C bit fields cannot be declared as static, that is, the data type modifier static cannot be used. Another important thing to keep in mind is that an array of bit fields do not exist and hence can\u2019t be implemented.<\/p>\n<p><em><strong>If you are struggling with<a href=\"https:\/\/data-flair.training\/blogs\/arrays-in-c\/\">\u00a0Array in C<\/a>, this is the right place to strengthen your fundamentals.<\/strong><\/em><\/p>\n<p><strong>Code on Screen<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/implementation-of-Bit-fields-in-C.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-59053 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/implementation-of-Bit-fields-in-C.jpg\" alt=\"How to implement Bit fields in C\" width=\"1301\" height=\"667\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/implementation-of-Bit-fields-in-C.jpg 1301w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/implementation-of-Bit-fields-in-C-150x77.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/implementation-of-Bit-fields-in-C-300x154.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/implementation-of-Bit-fields-in-C-768x394.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/implementation-of-Bit-fields-in-C-1024x525.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/implementation-of-Bit-fields-in-C-520x267.jpg 520w\" sizes=\"auto, (max-width: 1301px) 100vw, 1301px\" \/><\/a><\/p>\n<p><strong>Output<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Implementation-of-Bit-fields-in-C.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-59054 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Implementation-of-Bit-fields-in-C.jpg\" alt=\"Output of Implementation of Bit fields in C\" width=\"1296\" height=\"670\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Implementation-of-Bit-fields-in-C.jpg 1296w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Implementation-of-Bit-fields-in-C-150x78.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Implementation-of-Bit-fields-in-C-300x155.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Implementation-of-Bit-fields-in-C-768x397.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Implementation-of-Bit-fields-in-C-1024x529.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Implementation-of-Bit-fields-in-C-520x269.jpg 520w\" sizes=\"auto, (max-width: 1296px) 100vw, 1296px\" \/><\/a><\/p>\n<h2>Summary<\/h2>\n<p>In this tutorial, we discussed what are bit fields, its significance, and working. We have moved a step forward in a better understanding of the C programming language by completing this tutorial.<\/p>\n<p>Comment below your experience after exploring the underrated topic- bit fields in C. We have something that might fascinate you even more \u2013 <a href=\"https:\/\/data-flair.training\/blogs\/multi-dimensional-arrays-in-c\/\"><em><strong>Multi-dimensional Arrays in C<\/strong><\/em><\/a><\/p>\n<p>See you around!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bit fields in C are relatively very simple than all the topics we have covered so far. A bit field is simply a data structure that helps the user to allocate memory to structures&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":60022,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19488],"tags":[20107,20109,20108,20110],"class_list":["post-59044","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-programming","tag-c-bit-fields","tag-declare-bit-fields-in-c","tag-example-of-bit-fields","tag-implement-c-bit-fields"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Bit Fields in C - An Unrecognised Concept Omitted by C Aspirants - DataFlair<\/title>\n<meta name=\"description\" content=\"Bit fields in C is simply a data structure that helps a user to allocate memory to structures &amp; unions. Let&#039;s explore how to work, implement, declare bit fields with examples\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/bit-fields-in-c\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bit Fields in C - An Unrecognised Concept Omitted by C Aspirants - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Bit fields in C is simply a data structure that helps a user to allocate memory to structures &amp; unions. Let&#039;s explore how to work, implement, declare bit fields with examples\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/bit-fields-in-c\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-13T08:53:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-06-20T04:59:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Bit-Fields-in-C-Language.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"802\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Bit Fields in C - An Unrecognised Concept Omitted by C Aspirants - DataFlair","description":"Bit fields in C is simply a data structure that helps a user to allocate memory to structures & unions. Let's explore how to work, implement, declare bit fields with examples","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:\/\/data-flair.training\/blogs\/bit-fields-in-c\/","og_locale":"en_US","og_type":"article","og_title":"Bit Fields in C - An Unrecognised Concept Omitted by C Aspirants - DataFlair","og_description":"Bit fields in C is simply a data structure that helps a user to allocate memory to structures & unions. Let's explore how to work, implement, declare bit fields with examples","og_url":"https:\/\/data-flair.training\/blogs\/bit-fields-in-c\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2019-06-13T08:53:57+00:00","article_modified_time":"2019-06-20T04:59:52+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Bit-Fields-in-C-Language.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/bit-fields-in-c\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/bit-fields-in-c\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Bit Fields in C &#8211; An Unrecognised Concept Omitted by C Aspirants","datePublished":"2019-06-13T08:53:57+00:00","dateModified":"2019-06-20T04:59:52+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/bit-fields-in-c\/"},"wordCount":572,"commentCount":10,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/bit-fields-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Bit-Fields-in-C-Language.jpg","keywords":["C bit Fields","Declare Bit fields in C","Example of Bit fields","Implement C Bit Fields"],"articleSection":["C Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/bit-fields-in-c\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/bit-fields-in-c\/","url":"https:\/\/data-flair.training\/blogs\/bit-fields-in-c\/","name":"Bit Fields in C - An Unrecognised Concept Omitted by C Aspirants - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/bit-fields-in-c\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/bit-fields-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Bit-Fields-in-C-Language.jpg","datePublished":"2019-06-13T08:53:57+00:00","dateModified":"2019-06-20T04:59:52+00:00","description":"Bit fields in C is simply a data structure that helps a user to allocate memory to structures & unions. Let's explore how to work, implement, declare bit fields with examples","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/bit-fields-in-c\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/bit-fields-in-c\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/bit-fields-in-c\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Bit-Fields-in-C-Language.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Bit-Fields-in-C-Language.jpg","width":802,"height":420,"caption":"Bit Fields in C Language"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/bit-fields-in-c\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"C Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/c-programming\/"},{"@type":"ListItem","position":3,"name":"Bit Fields in C &#8211; An Unrecognised Concept Omitted by C Aspirants"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/59044","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=59044"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/59044\/revisions"}],"predecessor-version":[{"id":60023,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/59044\/revisions\/60023"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/60022"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=59044"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=59044"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=59044"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}