{"id":14050,"date":"2020-07-02T15:50:31","date_gmt":"2020-07-02T22:50:31","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=14050"},"modified":"2023-12-01T03:38:17","modified_gmt":"2023-12-01T11:38:17","slug":"c-plus-plus-string-to-int","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/c-plus-plus-string-to-int\/","title":{"rendered":"How to Convert String to Int C++"},"content":{"rendered":"\n<p><em>In C++ the <\/em><code><em>stoi()<\/em><\/code><em> function is used to convert data from a string type to an integer type, or int. If using C++03 or earlier, the <\/em><code><em>stringstream<\/em><\/code><em> class is used to convert string to int<\/em>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>In C++, data types are used to distinguish particular types of data. For example, strings are used to store text, booleans are used to store true\/false values, and integers are used to store whole numbers (numbers that do not have a decimal point).<\/p>\n\n\n\n<p>When writing code in C++, there are situations where you need to convert values between different types. For instance, you may want to convert a string to an integer so you can perform mathematical operations on the value.<\/p>\n\n\n\n<p>This tutorial will discuss, with reference to examples, how to convert a string to an integer in C++. We\u2019ll discuss two approaches you can use for a string to integer conversion operation that combined cover all versions of C++.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">C++ Data Types<\/h2>\n\n\n\n<p>There are a number of data types used in C++ to store data. For example, booleans are used to store true\/false values, floats are used to store floating-point (decimal) numbers, and strings are used to store text-based data.<\/p>\n\n\n\n<p>The type of data in which a value is stored affects how the value can be manipulated. For example, string operations can be used to manipulate the contents of strings, but they cannot be used with numerical values. So, when you\u2019re working with data, knowing how to convert values to a different data type can be useful.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">String to Int C++<\/h2>\n\n\n\n<p>There are two methods you can use to convert a string to an integer in C++.<\/p>\n\n\n\n<p>If you are using C++03 or an earlier version of the programming language, you should use the stringstream class. If you are using C++11 or above, you can use the <code>stoi()<\/code> function.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">stringstream Class<\/h3>\n\n\n\n<p>The stringstream class is used to convert a string to an integer in C++03 and in earlier versions of C++. Before we can use stringstream, we have to import it into our code. We can do so using an include statement like this:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>#include &lt;sstream&gt;<\/pre><\/div>\n\n\n\n<p>Now we\u2019re ready to start using the sstream class. Here\u2019s the syntax we can use to convert a string to an integer using stringstream: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>stringstream intValue(stringValue);\nint number = 0;\nintValue &gt;&gt; number;<\/pre><\/div>\n\n\n\n<p>Let&#8217;s break down this syntax into its main components, which are as follows:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>stringstream<\/strong> instructs our program to use the stringstream class, which we will use to convert a string to an integer.<\/li>\n\n\n\n<li><strong>intValue<\/strong> is used as an intermediary and holds the value of our string.<\/li>\n\n\n\n<li><strong>stringValue<\/strong> is the string we want to convert to an integer.<\/li>\n\n\n\n<li><strong>int number = 0;<\/strong> declares a variable called number which will hold our new integer value.<\/li>\n\n\n\n<li><strong>intValue &gt;&gt; number<\/strong> assigns the value stored in intValue to the number variable.<\/li>\n<\/ul>\n\n\n\n<p>Now, let\u2019s walk through an example to demonstrate this method in action. Suppose we are writing a program that checks whether a customer\u2019s ticket number for a cruise is valid. We have stored the customer\u2019s ticket number as a string, but we want to convert it into an integer for later use in our program. We could convert our string to an integer using this code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>#include &lt;iostream&gt;\n#include &lt;sstream&gt;\nusing namespace std;\nint main() {\n\tstring ticket = \"2029\";\n\tstringstream intTicket(ticketNumber);\n\tint ticketNumber = 0;\n\tintTicket &gt;&gt; ticketNumber;\n\tcout &lt;&lt; \"Ticket number: \" &lt;&lt; ticketNumber;\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>Ticket number: 2029<\/pre><\/div>\n\n\n\n<p>Let\u2019s break down our code. First, we import the sstream library, which we use to access the stringstream method. We then use the <code>using namespace std<\/code> notation to reduce the need to reference std when using methods from the standard library, such as cout.<\/p>\n\n\n\n<p>In our main program, we define a string called ticket which stores the customer\u2019s ticket number as a string value. We then use the stringstream method to convert the customer\u2019s ticket number to a string and assign the new value to the intTicket variable.<\/p>\n\n\n\n<p>Next, we declare a variable called ticketNumber and assign it the value 0. On the next line, we assign ticketNumber the value stored within the intTicket variable. Finally, we print out the statement <code>Ticket number:<\/code>, followed by the contents of the ticketNumber variable.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">stoi() Function<\/h3>\n\n\n\n<p>The <code>stoi()<\/code> function is used to convert a string to an integer in C++11 and above.<\/p>\n\n\n\n<p>The <code>stoi()<\/code> function makes it much easier to convert a string to an integer, given its more readable syntax. Here\u2019s the syntax for the <code>stoi()<\/code> function:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>int newValue = stoi(stringValue);<\/pre><\/div>\n\n\n\n<p>In this syntax, we pass one parameter through the <code>stoi()<\/code> method called stringValue. Then, we assign the integer returned by <code>stoi()<\/code> to the variable newValue.<\/p>\n\n\n\n<p>Let\u2019s return to the cruise ticket example from earlier. Suppose we want to convert the contents of a customer\u2019s ticket from a string value to an integer. 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;\n#include &lt;string&gt;\nusing namespace std;\nint main() {\n\tstring ticket = \"2029\";\n\tint ticketNumber = stoi(ticket);\n\tcout &lt;&lt; \"Ticket number: \" &lt;&lt; ticketNumber;\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>Ticket number: 2029<\/pre><\/div>\n\n\n\n<p>As you can see, this program is significantly shorter than our previous example, which shows the efficient syntax offered by <code>stoi()<\/code> in action.<\/p>\n\n\n\n<p>Now, let\u2019s break down our code. First, we import the string library which is used to work with strings in our program. We then declare that we are going to use the std namespace, like we did in the first example.<\/p>\n\n\n\n<p>In our main program, we define a variable called ticket and assign it the string value <code>2029<\/code>. Then, we use the <code>stoi()<\/code> method to convert the contents of the ticket variable to an integer and assign it to the variable ticketNumber. Finally, we print out the statement <code>Ticket number:<\/code> to the console, followed by the value stored in the ticketNumber variable.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The stringstream method is used to convert a string to an integer in C++03 and earlier, and the <code>stoi()<\/code> method is used to convert a string to an integer in C++11 and above.<\/p>\n\n\n\n<p>This tutorial discussed, with reference to examples, how to convert a string to an integer using stringstream and <code>stoi()<\/code> in C++. Now you\u2019re ready to start converting strings to integers in C++ like a professional developer!<\/p>\n","protected":false},"excerpt":{"rendered":"In C++ the stoi() function is used to convert data from a string type to an integer type, or int. If using C++03 or earlier, the stringstream class is used to convert string to int. In C++, data types are used to distinguish particular types of data. For example, strings are used to store text,&hellip;","protected":false},"author":240,"featured_media":14051,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17291],"tags":[],"class_list":{"0":"post-14050","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 Convert String to Int C++ | Career Karma<\/title>\n<meta name=\"description\" content=\"Converting strings to integers is a common programming operation in C++. On Career Karma, learn how to convert strings to integers in C++.\" \/>\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-string-to-int\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Convert String to Int C++\" \/>\n<meta property=\"og:description\" content=\"Converting strings to integers is a common programming operation in C++. On Career Karma, learn how to convert strings to integers in C++.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/c-plus-plus-string-to-int\/\" \/>\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-07-02T22:50:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T11:38:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/turned-on-silver-imac-with-might-mouse-and-keyboard-930530-2.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-string-to-int\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-string-to-int\\\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"How to Convert String to Int C++\",\"datePublished\":\"2020-07-02T22:50:31+00:00\",\"dateModified\":\"2023-12-01T11:38:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-string-to-int\\\/\"},\"wordCount\":964,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-string-to-int\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/turned-on-silver-imac-with-might-mouse-and-keyboard-930530-2.jpg\",\"articleSection\":[\"C++ Programming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-string-to-int\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-string-to-int\\\/\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-string-to-int\\\/\",\"name\":\"How to Convert String to Int C++ | Career Karma\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-string-to-int\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-string-to-int\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/turned-on-silver-imac-with-might-mouse-and-keyboard-930530-2.jpg\",\"datePublished\":\"2020-07-02T22:50:31+00:00\",\"dateModified\":\"2023-12-01T11:38:17+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Converting strings to integers is a common programming operation in C++. On Career Karma, learn how to convert strings to integers in C++.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-string-to-int\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-string-to-int\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-string-to-int\\\/#primaryimage\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/turned-on-silver-imac-with-might-mouse-and-keyboard-930530-2.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/turned-on-silver-imac-with-might-mouse-and-keyboard-930530-2.jpg\",\"width\":1020,\"height\":680},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/c-plus-plus-string-to-int\\\/#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\":\"How to Convert String to Int C++\"}]},{\"@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 Convert String to Int C++ | Career Karma","description":"Converting strings to integers is a common programming operation in C++. On Career Karma, learn how to convert strings to integers in C++.","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-string-to-int\/","og_locale":"en_US","og_type":"article","og_title":"How to Convert String to Int C++","og_description":"Converting strings to integers is a common programming operation in C++. On Career Karma, learn how to convert strings to integers in C++.","og_url":"https:\/\/careerkarma.com\/blog\/c-plus-plus-string-to-int\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-07-02T22:50:31+00:00","article_modified_time":"2023-12-01T11:38:17+00:00","og_image":[{"width":1020,"height":680,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/turned-on-silver-imac-with-might-mouse-and-keyboard-930530-2.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-string-to-int\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/c-plus-plus-string-to-int\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"How to Convert String to Int C++","datePublished":"2020-07-02T22:50:31+00:00","dateModified":"2023-12-01T11:38:17+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/c-plus-plus-string-to-int\/"},"wordCount":964,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/c-plus-plus-string-to-int\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/turned-on-silver-imac-with-might-mouse-and-keyboard-930530-2.jpg","articleSection":["C++ Programming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/c-plus-plus-string-to-int\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/c-plus-plus-string-to-int\/","url":"https:\/\/careerkarma.com\/blog\/c-plus-plus-string-to-int\/","name":"How to Convert String to Int C++ | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/c-plus-plus-string-to-int\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/c-plus-plus-string-to-int\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/turned-on-silver-imac-with-might-mouse-and-keyboard-930530-2.jpg","datePublished":"2020-07-02T22:50:31+00:00","dateModified":"2023-12-01T11:38:17+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Converting strings to integers is a common programming operation in C++. On Career Karma, learn how to convert strings to integers in C++.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/c-plus-plus-string-to-int\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/c-plus-plus-string-to-int\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/c-plus-plus-string-to-int\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/turned-on-silver-imac-with-might-mouse-and-keyboard-930530-2.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/turned-on-silver-imac-with-might-mouse-and-keyboard-930530-2.jpg","width":1020,"height":680},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/c-plus-plus-string-to-int\/#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":"How to Convert String to Int C++"}]},{"@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\/14050","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=14050"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/14050\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/14051"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=14050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=14050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=14050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}