{"id":225568,"date":"2023-10-18T22:48:08","date_gmt":"2023-10-18T22:48:08","guid":{"rendered":"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/"},"modified":"2023-10-18T22:48:08","modified_gmt":"2023-10-18T22:48:08","slug":"what-is-the-default-value-of-enum-in-c","status":"publish","type":"post","link":"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/","title":{"rendered":"What is the default value of enum in C?"},"content":{"rendered":"<p>\nEnum, short for enumeration, is a user-defined data type in C that consists of a set of named constant values. Each constant is given an identifier, also known as an enumerator. When an enum variable is declared without any initialization, what value does it take? Let&#8217;s dive into the topic and find out!<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_62 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#Default_Value_of_Enum_in_C\" title=\"Default Value of Enum in C:\">Default Value of Enum in C:<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#1_What_if_I_assign_a_different_explicit_value_to_the_first_enumerator_in_the_list\" title=\"1. What if I assign a different explicit value to the first enumerator in the list?\">1. What if I assign a different explicit value to the first enumerator in the list?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#2_How_can_I_print_the_name_of_the_enum_constant_instead_of_its_value\" title=\"2. How can I print the name of the enum constant instead of its value?\">2. How can I print the name of the enum constant instead of its value?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#3_Is_it_mandatory_to_assign_values_to_all_enum_constants\" title=\"3. Is it mandatory to assign values to all enum constants?\">3. Is it mandatory to assign values to all enum constants?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#4_Can_I_change_the_default_value_of_an_enum_in_C\" title=\"4. Can I change the default value of an enum in C?\">4. Can I change the default value of an enum in C?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#5_What_happens_if_an_enum_variable_is_assigned_a_value_outside_the_range_of_defined_constants\" title=\"5. What happens if an enum variable is assigned a value outside the range of defined constants?\">5. What happens if an enum variable is assigned a value outside the range of defined constants?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#6_Can_enum_constants_have_the_same_values\" title=\"6. Can enum constants have the same values?\">6. Can enum constants have the same values?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#7_What_is_the_purpose_of_using_enums_in_C\" title=\"7. What is the purpose of using enums in C?\">7. What is the purpose of using enums in C?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#8_How_can_I_assign_a_specific_value_to_an_enum_constant\" title=\"8. How can I assign a specific value to an enum constant?\">8. How can I assign a specific value to an enum constant?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#9_Can_I_compare_enum_variables_directly_using_equality_operators\" title=\"9. Can I compare enum variables directly using equality operators?\">9. Can I compare enum variables directly using equality operators?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#10_Is_it_possible_to_change_the_value_of_an_enum_variable\" title=\"10. Is it possible to change the value of an enum variable?\">10. Is it possible to change the value of an enum variable?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#11_Are_enum_constants_stored_as_integers_in_memory\" title=\"11. Are enum constants stored as integers in memory?\">11. Are enum constants stored as integers in memory?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#12_Can_I_assign_a_value_not_present_in_the_list_of_enum_constants_to_an_enum_variable\" title=\"12. Can I assign a value not present in the list of enum constants to an enum variable?\">12. Can I assign a value not present in the list of enum constants to an enum variable?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Default_Value_of_Enum_in_C\"><\/span><b>Default Value of Enum in C:<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\nThe <b>default value of an enum in C is the first enumerator<\/b> in the list of constants. In other words, if no explicit value is assigned to the enum variable during declaration, it will automatically be set to the first defined constant.<\/p>\n<p>Consider the following example:<br \/>\n&#8220;`c<br \/>\n#include <stdio.h><\/p>\n<p>enum Days {<br \/>\n    MONDAY,<br \/>\n    TUESDAY,<br \/>\n    WEDNESDAY,<br \/>\n    THURSDAY,<br \/>\n    FRIDAY,<br \/>\n    SATURDAY,<br \/>\n    SUNDAY<br \/>\n};<\/p>\n<p>int main() {<br \/>\n    enum Days today;<br \/>\n    printf(&#8220;Today is %dn&#8221;, today);  \/\/ Output: Today is 0<br \/>\n    return 0;<br \/>\n}<br \/>\n&#8220;`<br \/>\nIn this code snippet, we define an enumeration called &#8220;Days&#8221; with seven constants representing each day of the week. The enum variable &#8220;today&#8221; is declared without an explicit initialization. Consequently, its default value will be the first enumerator, in this case, &#8220;MONDAY,&#8221; which is associated with the value 0. Therefore, the output of the code will be &#8220;Today is 0.&#8221;<\/p>\n<p>It is essential to remember that the default value of an enum can be overridden by assigning an explicit value to the variable during declaration. Furthermore, subsequent enumerators in the list will have automatic values incremented by 1 from the preceding enumerator.<\/p>\n<p>Now, let&#8217;s explore some frequently asked questions related to the default value of an enum in C:<\/p>\n<h3><span class=\"ez-toc-section\" id=\"1_What_if_I_assign_a_different_explicit_value_to_the_first_enumerator_in_the_list\"><\/span>1. What if I assign a different explicit value to the first enumerator in the list?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nIf you assign an explicit value to the first enumerator, the default value of the enum variable will be the explicit value assigned to the first enumerator.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_How_can_I_print_the_name_of_the_enum_constant_instead_of_its_value\"><\/span>2. How can I print the name of the enum constant instead of its value?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nTo print the name of the enum constant, you can use a switch-case statement to map the values to their corresponding names and then print the names accordingly.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"3_Is_it_mandatory_to_assign_values_to_all_enum_constants\"><\/span>3. Is it mandatory to assign values to all enum constants?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nNo, it is not mandatory to assign values to all enum constants. If a value is not explicitly assigned, the compiler will assign automatic values based on the default behavior.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"4_Can_I_change_the_default_value_of_an_enum_in_C\"><\/span>4. Can I change the default value of an enum in C?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nNo, you cannot directly change the default value of an enum in C. It will always be the value associated with the first enumerator.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"5_What_happens_if_an_enum_variable_is_assigned_a_value_outside_the_range_of_defined_constants\"><\/span>5. What happens if an enum variable is assigned a value outside the range of defined constants?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nIf an enum variable is assigned a value outside the defined constants, it is considered invalid, and the code may exhibit undefined behavior.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"6_Can_enum_constants_have_the_same_values\"><\/span>6. Can enum constants have the same values?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, enum constants can have the same values. If multiple constants share the same value, they represent different names for the same underlying value.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"7_What_is_the_purpose_of_using_enums_in_C\"><\/span>7. What is the purpose of using enums in C?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nEnums are useful to define a set of named constant values, providing a more readable and understandable code compared to using arbitrary numerical values.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"8_How_can_I_assign_a_specific_value_to_an_enum_constant\"><\/span>8. How can I assign a specific value to an enum constant?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nTo assign a specific value to an enum constant, you can explicitly assign the desired value during its declaration, as long as it is unique within the enumeration.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"9_Can_I_compare_enum_variables_directly_using_equality_operators\"><\/span>9. Can I compare enum variables directly using equality operators?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, you can compare enum variables directly using equality and inequality operators, as their values represent distinct constant values.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"10_Is_it_possible_to_change_the_value_of_an_enum_variable\"><\/span>10. Is it possible to change the value of an enum variable?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, you can change the value of an enum variable by assigning it a valid value within the defined range of constants.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"11_Are_enum_constants_stored_as_integers_in_memory\"><\/span>11. Are enum constants stored as integers in memory?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, enum constants are internally stored as integers in memory, allowing easy comparison, assignment, and calculation operations.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"12_Can_I_assign_a_value_not_present_in_the_list_of_enum_constants_to_an_enum_variable\"><\/span>12. Can I assign a value not present in the list of enum constants to an enum variable?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nNo, you cannot directly assign a value not present in the list of enum constants to an enum variable. It can only hold one of the specified constant values.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Enum, short for enumeration, is a user-defined data type in C that consists of a set of named constant values. Each constant is given an identifier, also known as an enumerator. When an enum variable is declared without any initialization, what value does it take? Let&#8217;s dive into the topic and find out! Default Value &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"What is the default value of enum in C?\" class=\"read-more button\" href=\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#more-225568\">Read more<span class=\"screen-reader-text\">What is the default value of enum in C?<\/span><\/a><\/p>\n","protected":false},"author":56,"featured_media":107420,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86279],"tags":[],"class_list":["post-225568","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learn","no-featured-image-padding"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What is the default value of enum in C?<\/title>\n<meta name=\"description\" content=\"Enum, short for enumeration, is a user-defined data type in C that consists of a set of named constant values. Each constant is given an identifier, also\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is the default value of enum in C?\" \/>\n<meta property=\"og:description\" content=\"Enum, short for enumeration, is a user-defined data type in C that consists of a set of named constant values. Each constant is given an identifier, also\" \/>\n<meta property=\"og:url\" content=\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/\" \/>\n<meta property=\"og:site_name\" content=\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/synchronyfinancial\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-18T22:48:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"500\" \/>\n\t<meta property=\"og:image:height\" content=\"164\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Sarah Prince\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@synchrony\" \/>\n<meta name=\"twitter:site\" content=\"@synchrony\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sarah Prince\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/\"},\"author\":{\"name\":\"Sarah Prince\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/80e5190de9e3c306f162d2194af9fcec\"},\"headline\":\"What is the default value of enum in C?\",\"datePublished\":\"2023-10-18T22:48:08+00:00\",\"dateModified\":\"2023-10-18T22:48:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/\"},\"wordCount\":688,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\"},\"articleSection\":[\"Learn\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/\",\"name\":\"What is the default value of enum in C?\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\"},\"datePublished\":\"2023-10-18T22:48:08+00:00\",\"dateModified\":\"2023-10-18T22:48:08+00:00\",\"description\":\"Enum, short for enumeration, is a user-defined data type in C that consists of a set of named constant values. Each constant is given an identifier, also\",\"breadcrumb\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/namso-gen.co\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is the default value of enum in C?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\",\"url\":\"https:\/\/namso-gen.co\/blog\/\",\"name\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\",\"description\":\"In Namso gen blog you can get many tips regarding to Credit cards, VCC, Credit card security etc. You can generate credit cards by using Namso-gen.co\",\"publisher\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/namso-gen.co\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\",\"name\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\",\"url\":\"https:\/\/namso-gen.co\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\",\"contentUrl\":\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\",\"width\":500,\"height\":164,\"caption\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\"},\"image\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/synchronyfinancial\",\"https:\/\/twitter.com\/synchrony\",\"https:\/\/www.youtube.com\/synchronyfinancial\",\"https:\/\/www.instagram.com\/synchrony\",\"https:\/\/www.linkedin.com\/company\/synchrony-financial\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/80e5190de9e3c306f162d2194af9fcec\",\"name\":\"Sarah Prince\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"caption\":\"Sarah Prince\"},\"description\":\"Guest author Sarah Prince has meticulously crafted and revised this article to the best of their knowledge and understanding. Readers are strongly advised to exercise caution, verify information independently, and rely on their own judgment when considering the information provided. Read more articles on Namso Gen here.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is the default value of enum in C?","description":"Enum, short for enumeration, is a user-defined data type in C that consists of a set of named constant values. Each constant is given an identifier, also","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:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/","og_locale":"en_US","og_type":"article","og_title":"What is the default value of enum in C?","og_description":"Enum, short for enumeration, is a user-defined data type in C that consists of a set of named constant values. Each constant is given an identifier, also","og_url":"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/","og_site_name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","article_publisher":"https:\/\/www.facebook.com\/synchronyfinancial","article_published_time":"2023-10-18T22:48:08+00:00","og_image":[{"width":500,"height":164,"url":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","type":"image\/png"}],"author":"Sarah Prince","twitter_card":"summary_large_image","twitter_creator":"@synchrony","twitter_site":"@synchrony","twitter_misc":{"Written by":"Sarah Prince","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#article","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/"},"author":{"name":"Sarah Prince","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/80e5190de9e3c306f162d2194af9fcec"},"headline":"What is the default value of enum in C?","datePublished":"2023-10-18T22:48:08+00:00","dateModified":"2023-10-18T22:48:08+00:00","mainEntityOfPage":{"@id":"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/"},"wordCount":688,"commentCount":0,"publisher":{"@id":"https:\/\/namso-gen.co\/blog\/#organization"},"articleSection":["Learn"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/","url":"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/","name":"What is the default value of enum in C?","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/#website"},"datePublished":"2023-10-18T22:48:08+00:00","dateModified":"2023-10-18T22:48:08+00:00","description":"Enum, short for enumeration, is a user-defined data type in C that consists of a set of named constant values. Each constant is given an identifier, also","breadcrumb":{"@id":"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/namso-gen.co\/blog\/what-is-the-default-value-of-enum-in-c\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/namso-gen.co\/blog\/"},{"@type":"ListItem","position":2,"name":"What is the default value of enum in C?"}]},{"@type":"WebSite","@id":"https:\/\/namso-gen.co\/blog\/#website","url":"https:\/\/namso-gen.co\/blog\/","name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","description":"In Namso gen blog you can get many tips regarding to Credit cards, VCC, Credit card security etc. You can generate credit cards by using Namso-gen.co","publisher":{"@id":"https:\/\/namso-gen.co\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/namso-gen.co\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/namso-gen.co\/blog\/#organization","name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","url":"https:\/\/namso-gen.co\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","contentUrl":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","width":500,"height":164,"caption":"Namso Gen Blog - Free Credit Card Generator [100% Valid]"},"image":{"@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/synchronyfinancial","https:\/\/twitter.com\/synchrony","https:\/\/www.youtube.com\/synchronyfinancial","https:\/\/www.instagram.com\/synchrony","https:\/\/www.linkedin.com\/company\/synchrony-financial"]},{"@type":"Person","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/80e5190de9e3c306f162d2194af9fcec","name":"Sarah Prince","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"Sarah Prince"},"description":"Guest author Sarah Prince has meticulously crafted and revised this article to the best of their knowledge and understanding. Readers are strongly advised to exercise caution, verify information independently, and rely on their own judgment when considering the information provided. Read more articles on Namso Gen here."}]}},"_links":{"self":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/225568","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/users\/56"}],"replies":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/comments?post=225568"}],"version-history":[{"count":0,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/225568\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/media\/107420"}],"wp:attachment":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/media?parent=225568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/categories?post=225568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/tags?post=225568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}