{"id":14055,"date":"2020-03-30T16:48:26","date_gmt":"2020-03-30T23:48:26","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=14055"},"modified":"2023-12-01T02:35:44","modified_gmt":"2023-12-01T10:35:44","slug":"c-plus-plus-enum","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/c-plus-plus-enum\/","title":{"rendered":"C++ Enum"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">How to Use C++ Enum: A Guide<\/h2>\n\n\n\n<p>An enumerated type is a user-defined data type which can be assigned one value from a range of values.&nbsp;<\/p>\n\n\n\n<p>Enums are often used in programming when a variable should only be able to store one value out of a specific set of values. For example, if you wanted a variable to only store days of the week, you may want to use an enumeration.<\/p>\n\n\n\n<p>This tutorial will explore, with reference to examples, the basics of enumerations in C++, how to define an enumeration, and how to use an enumeration in your code. By the end of reading this tutorial, you\u2019ll be an expert at using enums in C++.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">C++ Enum<\/h2>\n\n\n\n<p>The enumerated type, also known as the enum type, is used to create a custom data type that has a fixed range of possible values. Enumeration is a user-defined data type.<\/p>\n\n\n\n<p>To define an enum in C++, the enum keyword is used. Here\u2019s the syntax for defining an enum in C++:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>enum name {\n\tfirstValue, secondValue, thirdValue, fourthValue\n};<\/pre><\/div>\n\n\n\n<p>Let\u2019s break down this syntax into its main components:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>enum<\/strong> instructs our code to create an enumeration.<\/li>\n\n\n\n<li><strong>name<\/strong> is the name assigned to our enumeration.<\/li>\n\n\n\n<li><strong>firstValue<\/strong>, <strong>secondValue<\/strong>, <strong>thirdValue<\/strong>, and <strong>fourthValue<\/strong> are the values assigned to our enumeration. These values are enclosed within a set of curly brackets ({}).<\/li>\n<\/ul>\n\n\n\n<p>In addition, you can also change the default value of an enum class. So, if you wanted a value to have its own name, you could do so by assigning its entry in the enumeration a new default value. Here\u2019s the code we could use to accomplish this task:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>enum name {\n\tfirstValue = 0,\n\tsecondValue = 1\n}<\/pre><\/div>\n\n\n\n<p>In this syntax, our enum contains two values. The firstValue value has the value 0, and the secondValue value has the value 1.<\/p>\n\n\n\n<p>Enums are useful because they allow you to more clearly define the potential values a variable can hold. For instance, if you only want a variable to store days of the week, declaring an enum makes it clear in your code that the variable should only be able to store days of the week.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Declare an Enum<\/h2>\n\n\n\n<p>Suppose we are creating an application which allows a cashier at a donut shop to record each order that has been placed and calculate the cost of the donut.<\/p>\n\n\n\n<p>Our shop only sells a limited range of donuts, and so we only want the cashier to be able to record orders for the donuts in our inventory. The donuts we want our program to process are: Raspberry, Strawberry, Powdered, Chocolate, and Cinnamon.<\/p>\n\n\n\n<p>This is a perfect example of where an enum could be useful. We want to limit our program to be able to process orders in the aforementioned flavors, and so using an enum is a good idea. Here\u2019s the code we could use to declare a C++ enum:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>enum flavors {\n\tRaspberry, Strawberry, Powdered, Chocolate, Cinnamon\n}<\/pre><\/div>\n\n\n\n<p>In our code, we declare an enum called flavors which has five potential values. So, when we try to assign a variable a value from this enum, the only values the variable will be able to store are those which are declared in our enum.<\/p>\n\n\n\n<p>If we want to declare a variable that can only hold values from our flavors enum, we can use this syntax:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>enum flavors orderFlavor.<\/pre><\/div>\n\n\n\n<p>The variable orderFlavor we have just declared can only store values in the flavors enum.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using an Enum<\/h2>\n\n\n\n<p>Now that we have performed an enum declaration, we can use it in our code. Let\u2019s return to the donut store example to illustrate how we can use an enum in a C++ program.<\/p>\n\n\n\n<p>Suppose we are building a program that allows our donut store cashier to record each order. The cashier has just received an order for a raspberry donut, and we want to create an order for a raspberry donut in our program. We could do so using this code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>#include &lt;iostream&gt;\nusing namespace std;\nenum flavors {\n\tRaspberry, Strawberry, Powdered, Chocolate, Cinnamon\n}\nint main() {\n\tenum flavors orderFlavor;\n\torderFlavor = Raspberry;\n\tcout &lt;&lt; \"Donut ordered: 1x \" &lt;&lt; orderFlavor;\n}<\/pre><\/div>\n\n\n\n<p>Our code returns:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Donut ordered: 1x Raspberry<\/pre><\/div>\n\n\n\n<p>Let\u2019s break down our code. First, we have declared an enum called flavors which stores the flavors sold at the donut shop.<\/p>\n\n\n\n<p>Then, we declare a variable called orderFlavor which keeps track of the type of donut ordered by a customer. This variable can only store values in the flavors enum. On the next line of code, we assign the orderFlavor enum variable the value Raspberry.<\/p>\n\n\n\n<p>Next, we print out <code>Donut ordered: 1x<\/code>  to the console, followed by the value stored in the orderFlavor variable.<\/p>\n\n\n\n<p>In this example, you can see that using an enum makes our code easier to read. By using an enum, it is clear that the orderFlavor variable can only store values in the flavors enum. If we were working on a more complex program, the benefits of using enums would become even more clear, as there would be more variables for which we would need to account.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Changing Default Enum Values<\/h2>\n\n\n\n<p>In addition, we can also assign enums a particular default value. For instance, suppose we wanted to build a program that returns the price of a particular donut. Because there are a limited range of donuts a customer can order, we want to use an enum.<\/p>\n\n\n\n<p>We could use the following code to create an enum that stores both our donut flavors and their prices:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>#include &lt;iostream&gt;\nusing namespace std;\nenum prices {\n\tRaspberry = 2.00,\nStrawberry = 2.00,\nPowdered = 1.75,\nChocolate = 1.90,\nCinnamon = 2.20\n}\nint main() {\n\tenum prices orderPrice;\n\torderPrice = Raspberry;\n\tcout &lt;&lt; \"Donut price: $\" &lt;&lt; orderPrice;\n}<\/pre><\/div>\n\n\n\n<p>Our code returns: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Donut price: $2.00<\/pre><\/div>\n\n\n\n<p>In this example, we have assigned each value in our enum a default value.<\/p>\n\n\n\n<p>This means that, when we reference a value in our enum, its default value will appear instead of the name of the value. So, when we reference Chocolate, 1.90 will be returned; when we reference Cinnamon, 2.20 will be returned.<\/p>\n\n\n\n<p>In our main program, we first declare a variable called orderPrice which uses the prices enum to restrict its possible values. Then we assign the orderPrice variable the value associated with Raspberry in our prices enum.<\/p>\n\n\n\n<p>On the next line, we print the statement <code>Donut price: $<\/code> to the console, followed by the price stored in the orderPrice variable. In this case, the customer ordered a raspberry donut, which costs $2.00, So, our code returned <code>Donut price: $2.00<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The enum data type is used to create a type of data that can only store a fixed set of values. For instance, an enumeration that stores seasons would only store spring, summer, autumn, and winter. Enums are useful when a variable should only be capable of storing one value that exists in a specific set of values.<\/p>\n\n\n\n<p>This tutorial discussed, with reference to examples, how to create an enum in C++, how to use an enum, and how to change the default values stored by an enum. Now you have the know-how to start using enums in C++!<\/p>\n","protected":false},"excerpt":{"rendered":"How to Use C++ Enum: A Guide An enumerated type is a user-defined data type which can be assigned one value from a range of values.&nbsp; Enums are often used in programming when a variable should only be able to store one value out of a specific set of values. For example, if you wanted&hellip;","protected":false},"author":240,"featured_media":14056,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17291],"tags":[],"class_list":{"0":"post-14055","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-c-plus-plus"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"C++","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":"","is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Use C++ Enum?<\/title>\n<meta name=\"description\" content=\"Enums are used in C++ to define data types that can store a fixed set of values. On Career Karma, learn how to use enums in your code.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/c-plus-plus-enum\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C++ Enum\" \/>\n<meta property=\"og:description\" content=\"Enums are used in C++ to define data types that can store a fixed set of values. On Career Karma, learn how to use enums in your code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/c-plus-plus-enum\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-30T23:48:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T10:35:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-in-orange-crew-neck-t-shirt-sitting-on-brown-wooden-3762368.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"680\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Gallagher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Gallagher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-enum\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-enum\\\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"C++ Enum\",\"datePublished\":\"2020-03-30T23:48:26+00:00\",\"dateModified\":\"2023-12-01T10:35:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-enum\\\/\"},\"wordCount\":1085,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-enum\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/woman-in-orange-crew-neck-t-shirt-sitting-on-brown-wooden-3762368.jpg\",\"articleSection\":[\"C++ Programming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-enum\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-enum\\\/\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-enum\\\/\",\"name\":\"How to Use C++ Enum?\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-enum\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-enum\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/woman-in-orange-crew-neck-t-shirt-sitting-on-brown-wooden-3762368.jpg\",\"datePublished\":\"2020-03-30T23:48:26+00:00\",\"dateModified\":\"2023-12-01T10:35:44+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Enums are used in C++ to define data types that can store a fixed set of values. On Career Karma, learn how to use enums in your code.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-enum\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-enum\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-enum\\\/#primaryimage\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/woman-in-orange-crew-neck-t-shirt-sitting-on-brown-wooden-3762368.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/woman-in-orange-crew-neck-t-shirt-sitting-on-brown-wooden-3762368.jpg\",\"width\":1020,\"height\":680},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-enum\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C++ Programming\",\"item\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"C++ Enum\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/james-gallagher-150x150.jpg\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/author\\\/jamesgallagher\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Use C++ Enum?","description":"Enums are used in C++ to define data types that can store a fixed set of values. On Career Karma, learn how to use enums in your code.","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:\/\/careerkarma.com\/blog\/c-plus-plus-enum\/","og_locale":"en_US","og_type":"article","og_title":"C++ Enum","og_description":"Enums are used in C++ to define data types that can store a fixed set of values. On Career Karma, learn how to use enums in your code.","og_url":"https:\/\/careerkarma.com\/blog\/c-plus-plus-enum\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-03-30T23:48:26+00:00","article_modified_time":"2023-12-01T10:35:44+00:00","og_image":[{"width":1020,"height":680,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-in-orange-crew-neck-t-shirt-sitting-on-brown-wooden-3762368.jpg","type":"image\/jpeg"}],"author":"James Gallagher","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"James Gallagher","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/c-plus-plus-enum\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/c-plus-plus-enum\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"C++ Enum","datePublished":"2020-03-30T23:48:26+00:00","dateModified":"2023-12-01T10:35:44+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/c-plus-plus-enum\/"},"wordCount":1085,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/c-plus-plus-enum\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-in-orange-crew-neck-t-shirt-sitting-on-brown-wooden-3762368.jpg","articleSection":["C++ Programming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/c-plus-plus-enum\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/c-plus-plus-enum\/","url":"https:\/\/careerkarma.com\/blog\/c-plus-plus-enum\/","name":"How to Use C++ Enum?","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/c-plus-plus-enum\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/c-plus-plus-enum\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-in-orange-crew-neck-t-shirt-sitting-on-brown-wooden-3762368.jpg","datePublished":"2020-03-30T23:48:26+00:00","dateModified":"2023-12-01T10:35:44+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Enums are used in C++ to define data types that can store a fixed set of values. On Career Karma, learn how to use enums in your code.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/c-plus-plus-enum\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/c-plus-plus-enum\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/c-plus-plus-enum\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-in-orange-crew-neck-t-shirt-sitting-on-brown-wooden-3762368.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-in-orange-crew-neck-t-shirt-sitting-on-brown-wooden-3762368.jpg","width":1020,"height":680},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/c-plus-plus-enum\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"C++ Programming","item":"https:\/\/careerkarma.com\/blog\/c-plus-plus\/"},{"@type":"ListItem","position":3,"name":"C++ Enum"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/14055","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=14055"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/14055\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/14056"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=14055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=14055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=14055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}