{"id":221,"date":"2020-08-31T16:13:42","date_gmt":"2020-08-31T16:13:42","guid":{"rendered":"https:\/\/www.kindsonthegenius.com\/cplusplus\/?p=221"},"modified":"2020-08-31T16:13:42","modified_gmt":"2020-08-31T16:13:42","slug":"c-oop-basics","status":"publish","type":"post","link":"https:\/\/kindsonthegenius.com\/cplusplus\/c-oop-basics\/","title":{"rendered":"C++ OOP &#8211; Basics"},"content":{"rendered":"<p>We are not stepping into\u00a0 the world of OOP. Somehow, every modern programming language supports some form of OOP features.<\/p>\n<p>Let&#8217;s first get through the basics of OOP under the following sub-topics:<\/p>\n<ol>\n<li><a href=\"#t1\">What is OOP?<\/a><\/li>\n<li><a href=\"#t2\">Creating Classes in C++<\/a><\/li>\n<li><a href=\"#t3\">Creating Objects from Class<\/a><\/li>\n<li><a href=\"#t4\">Accessing Data Members and Member Functions<\/a><\/li>\n<li><a href=\"#t5\">Benefits of Object Oriented Programming<\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t1\">1. What is OOP?<\/strong><\/h4>\n<p>OOP in C++, or in programming generally, stands for Object Oriented Programming. This is an approach to programming where programs are written based on <em><strong>classes<\/strong> <\/em>and <em><strong>objects<\/strong><\/em>. These are the two key aspect of OOP.<\/p>\n<p>An object is a representation a real object. Just look around you, or just think for a minute! Everything is basically an object: phone, keyboard, mouse, pen, computer, food, camera, banana, apple, bike, car, dog etc.<\/p>\n<p>So we can say an object is made up of <strong><em>attributes<\/em> <\/strong>and <em><strong>methods<\/strong><\/em>.<\/p>\n<p>A class is a blueprint of an object. Basically, we can create objects from classes. In other words, an object is an instance of a class.<\/p>\n<p>The figure below illustrates this:<\/p>\n<p><a href=\"https:\/\/kindsonthegenius.com\/cplusplus\/wp-content\/uploads\/2020\/08\/Object-vs-Classes.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-222 aligncenter\" src=\"https:\/\/kindsonthegenius.com\/cplusplus\/wp-content\/uploads\/2020\/08\/Object-vs-Classes-300x60.jpg\" alt=\"Object vs Classes\" width=\"300\" height=\"60\" srcset=\"https:\/\/kindsonthegenius.com\/cplusplus\/wp-content\/uploads\/2020\/08\/Object-vs-Classes-300x60.jpg 300w, https:\/\/kindsonthegenius.com\/cplusplus\/wp-content\/uploads\/2020\/08\/Object-vs-Classes.jpg 659w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>You can also think of fruits: apple, orange, banana, etc<\/p>\n<p>How does all of this relate to programing? Well, Let&#8217;s see<\/p>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t2\">2. Creating Classes\u00a0 C++<\/strong><\/h4>\n<p>Since we now know what classes an object are, we should be able to create them. We define a class in C++ using the class keyword. Then we provide the class name followed by curly braces. Inside, the curly braces, we then specify it&#8217;s attributes and methods.<\/p>\n<p>Here&#8217;s a class that represents a circle<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #008800; font-weight: bold;\">class<\/span> <span style=\"color: #bb0066; font-weight: bold;\">Square<\/span> {\r\n<span style=\"color: #997700; font-weight: bold;\">public:<\/span> \r\n\t<span style=\"color: #333399; font-weight: bold;\">double<\/span> length;\r\n\t<span style=\"color: #333399; font-weight: bold;\">double<\/span> width;\r\n\t\r\n\t<span style=\"color: #333399; font-weight: bold;\">double<\/span> <span style=\"color: #0066bb; font-weight: bold;\">calculateArea<\/span>(){\r\n\t\t<span style=\"color: #008800; font-weight: bold;\">return<\/span> length <span style=\"color: #333333;\">*<\/span> width;\r\n\t}\r\n\t\r\n\t<span style=\"color: #333399; font-weight: bold;\">double<\/span> <span style=\"color: #0066bb; font-weight: bold;\">calculatePerimeter<\/span>(){\r\n\t\t<span style=\"color: #008800; font-weight: bold;\">return<\/span> <span style=\"color: #0000dd; font-weight: bold;\">2<\/span> <span style=\"color: #333333;\">*<\/span> length <span style=\"color: #333333;\">*<\/span> width;\r\n\t}\r\n};\r\n<\/pre>\n<p>So we created a class named Circle.<\/p>\n<p>The variables length and width are the attributes of the class. They are also called <strong><em>data members<\/em><\/strong> or<em><strong> member variables<\/strong><\/em>.<\/p>\n<p>The functions calculateArea() and calculatePerimeter() are known as <em><strong>member functions<\/strong><\/em>.<\/p>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t3\">3. Creating Objects from Class<\/strong><\/h4>\n<p>As mentioned before, a class is a blueprint for creating objects. Therefore, once you have a class, you can start creating objects from it.<\/p>\n<p>Creating objects from a class in called instantiation. So we can, &#8220;<strong>instantiate a circle<\/strong>&#8220;. In order words, create an instance of a Square or object of type, Square.<\/p>\n<p>Objects are instantiated same way we create <a href=\"https:\/\/kindsonthegenius.com\/cplusplus\/c-data-structures\/\" target=\"_blank\" rel=\"noopener noreferrer\">Structs<\/a> or declare variables. For example:<\/p>\n<pre style=\"margin: 0; line-height: 125%;\">Square square1; <span style=\"color: #888888;\">\/\/Declare square1 of type Square<\/span>\r\nSquare square2; <span style=\"color: #888888;\">\/\/Declare square1 of type Square<\/span>\r\n<\/pre>\n<p>This code instantiates two Squares, square1 and square2.<\/p>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t4\">.4. Accessing Data Members &amp; Member Functions<\/strong><\/h4>\n<p>So if we have created an object, we should be able to access it&#8217;s attributes(data members). Or we may want to call it&#8217;s member functions.<\/p>\n<p>To achieve this, we use the dot(.) operator.<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #557799;\">#include &lt;iostream&gt;<\/span>\r\n<span style=\"color: #557799;\">#include \"Square.cpp\" <\/span><span style=\"color: #888888;\">\/\/the class is in another file<\/span>\r\n\r\n<span style=\"color: #008800; font-weight: bold;\">using<\/span> <span style=\"color: #008800; font-weight: bold;\">namespace<\/span> std;\r\n\r\n<span style=\"color: #888888;\">\/\/ main function<\/span>\r\n<span style=\"color: #333399; font-weight: bold;\">int<\/span> <span style=\"color: #0066bb; font-weight: bold;\">main<\/span> () {\r\n\r\n\t<span style=\"color: #888888;\">\/\/Create a new Square, square1<\/span>\r\n\tSquare square1;\r\n\r\n\t<span style=\"color: #888888;\">\/\/assign values to the data members<\/span>\r\n\tsquare1.length <span style=\"color: #333333;\">=<\/span> <span style=\"color: #6600ee; font-weight: bold;\">20.2<\/span>;\r\n\tsquare1.width <span style=\"color: #333333;\">=<\/span> <span style=\"color: #6600ee; font-weight: bold;\">10.5<\/span>;\r\n\r\n\t<span style=\"color: #888888;\">\/\/Calculate the area and perimeter<\/span>\r\n\tcout <span style=\"color: #333333;\">&lt;&lt;<\/span><span style=\"background-color: #fff0f0;\">\"Area is: \"<\/span> <span style=\"color: #333333;\">&lt;&lt;<\/span> square1.calculateArea()<span style=\"color: #333333;\">&lt;&lt;<\/span>endl;\r\n\tcout <span style=\"color: #333333;\">&lt;&lt;<\/span><span style=\"background-color: #fff0f0;\">\"Perimeter is: \"<\/span> <span style=\"color: #333333;\">&lt;&lt;<\/span> square1.calculatePerimeter() <span style=\"color: #333333;\">&lt;&lt;<\/span>endl;\r\n\r\n   <span style=\"color: #008800; font-weight: bold;\">return<\/span> <span style=\"color: #0000dd; font-weight: bold;\">0<\/span>;\r\n}\r\n<\/pre>\n<p>Output is:<\/p>\n<pre style=\"margin: 0; line-height: 125%;\">Area is: 212.1\r\nPerimeter is: 424.2\r\n<\/pre>\n<p>one thing I would you to see from the program is that the class is defined in another file, <em>Square.cpp<\/em>. Then it is included in the main file using the <strong>#include<\/strong> directive.<\/p>\n<p>Also note that the data members and member functions are declared a public. This means that they can be accessed from anywhere from the program.<\/p>\n<p>Now\u00a0 we have cover some basics of OOP. But there&#8217;s yet much to learn. So let me end this lesson by mentioning few benefits of OOP<\/p>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t5\">5. Benefits of OOP<\/strong><\/h4>\n<ul>\n<li>make the program clearer and more readable<\/li>\n<li>OOP programs are faster in execution<\/li>\n<li>they help to create easier to maintain codes since classes can be reused<\/li>\n<li>less code and shorter development time<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>We are not stepping into\u00a0 the world of OOP. Somehow, every modern programming language supports some form of OOP features. Let&#8217;s first get through the &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2,35],"tags":[36],"class_list":["post-221","post","type-post","status-publish","format-standard","hentry","category-c-tutorials","category-oop","tag-oop"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>C++ OOP - Basics - C++ Tutorials<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kindsonthegenius.com\/cplusplus\/c-oop-basics\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C++ OOP - Basics - C++ Tutorials\" \/>\n<meta property=\"og:description\" content=\"We are not stepping into\u00a0 the world of OOP. Somehow, every modern programming language supports some form of OOP features. Let&#8217;s first get through the &hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kindsonthegenius.com\/cplusplus\/c-oop-basics\/\" \/>\n<meta property=\"og:site_name\" content=\"C++ Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2020-08-31T16:13:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/kindsonthegenius.com\/cplusplus\/wp-content\/uploads\/2020\/08\/Object-vs-Classes-300x60.jpg\" \/>\n<meta name=\"author\" content=\"kindsonthegenius\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"kindsonthegenius\" \/>\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:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/c-oop-basics\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/c-oop-basics\\\/\"},\"author\":{\"name\":\"kindsonthegenius\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/#\\\/schema\\\/person\\\/59a11a9f72bb132f56f91ab9f8a58a0e\"},\"headline\":\"C++ OOP &#8211; Basics\",\"datePublished\":\"2020-08-31T16:13:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/c-oop-basics\\\/\"},\"wordCount\":541,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/c-oop-basics\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/Object-vs-Classes-300x60.jpg\",\"keywords\":[\"OOP\"],\"articleSection\":[\"C++ Tutorials\",\"OOP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/c-oop-basics\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/c-oop-basics\\\/\",\"url\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/c-oop-basics\\\/\",\"name\":\"C++ OOP - Basics - C++ Tutorials\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/c-oop-basics\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/c-oop-basics\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/Object-vs-Classes-300x60.jpg\",\"datePublished\":\"2020-08-31T16:13:42+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/#\\\/schema\\\/person\\\/59a11a9f72bb132f56f91ab9f8a58a0e\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/c-oop-basics\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/c-oop-basics\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/c-oop-basics\\\/#primaryimage\",\"url\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/Object-vs-Classes.jpg\",\"contentUrl\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/Object-vs-Classes.jpg\",\"width\":659,\"height\":131,\"caption\":\"Object vs Classes\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/c-oop-basics\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C++ OOP &#8211; Basics\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/#website\",\"url\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/\",\"name\":\"C++ Tutorials\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/#\\\/schema\\\/person\\\/59a11a9f72bb132f56f91ab9f8a58a0e\",\"name\":\"kindsonthegenius\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g\",\"caption\":\"kindsonthegenius\"},\"url\":\"https:\\\/\\\/kindsonthegenius.com\\\/cplusplus\\\/author\\\/kindsonthegenius-3\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C++ OOP - Basics - C++ Tutorials","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:\/\/kindsonthegenius.com\/cplusplus\/c-oop-basics\/","og_locale":"en_US","og_type":"article","og_title":"C++ OOP - Basics - C++ Tutorials","og_description":"We are not stepping into\u00a0 the world of OOP. Somehow, every modern programming language supports some form of OOP features. Let&#8217;s first get through the &hellip;","og_url":"https:\/\/kindsonthegenius.com\/cplusplus\/c-oop-basics\/","og_site_name":"C++ Tutorials","article_published_time":"2020-08-31T16:13:42+00:00","og_image":[{"url":"https:\/\/kindsonthegenius.com\/cplusplus\/wp-content\/uploads\/2020\/08\/Object-vs-Classes-300x60.jpg","type":"","width":"","height":""}],"author":"kindsonthegenius","twitter_card":"summary_large_image","twitter_misc":{"Written by":"kindsonthegenius","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kindsonthegenius.com\/cplusplus\/c-oop-basics\/#article","isPartOf":{"@id":"https:\/\/kindsonthegenius.com\/cplusplus\/c-oop-basics\/"},"author":{"name":"kindsonthegenius","@id":"https:\/\/kindsonthegenius.com\/cplusplus\/#\/schema\/person\/59a11a9f72bb132f56f91ab9f8a58a0e"},"headline":"C++ OOP &#8211; Basics","datePublished":"2020-08-31T16:13:42+00:00","mainEntityOfPage":{"@id":"https:\/\/kindsonthegenius.com\/cplusplus\/c-oop-basics\/"},"wordCount":541,"commentCount":0,"image":{"@id":"https:\/\/kindsonthegenius.com\/cplusplus\/c-oop-basics\/#primaryimage"},"thumbnailUrl":"https:\/\/kindsonthegenius.com\/cplusplus\/wp-content\/uploads\/2020\/08\/Object-vs-Classes-300x60.jpg","keywords":["OOP"],"articleSection":["C++ Tutorials","OOP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kindsonthegenius.com\/cplusplus\/c-oop-basics\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kindsonthegenius.com\/cplusplus\/c-oop-basics\/","url":"https:\/\/kindsonthegenius.com\/cplusplus\/c-oop-basics\/","name":"C++ OOP - Basics - C++ Tutorials","isPartOf":{"@id":"https:\/\/kindsonthegenius.com\/cplusplus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/kindsonthegenius.com\/cplusplus\/c-oop-basics\/#primaryimage"},"image":{"@id":"https:\/\/kindsonthegenius.com\/cplusplus\/c-oop-basics\/#primaryimage"},"thumbnailUrl":"https:\/\/kindsonthegenius.com\/cplusplus\/wp-content\/uploads\/2020\/08\/Object-vs-Classes-300x60.jpg","datePublished":"2020-08-31T16:13:42+00:00","author":{"@id":"https:\/\/kindsonthegenius.com\/cplusplus\/#\/schema\/person\/59a11a9f72bb132f56f91ab9f8a58a0e"},"breadcrumb":{"@id":"https:\/\/kindsonthegenius.com\/cplusplus\/c-oop-basics\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kindsonthegenius.com\/cplusplus\/c-oop-basics\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kindsonthegenius.com\/cplusplus\/c-oop-basics\/#primaryimage","url":"https:\/\/kindsonthegenius.com\/cplusplus\/wp-content\/uploads\/2020\/08\/Object-vs-Classes.jpg","contentUrl":"https:\/\/kindsonthegenius.com\/cplusplus\/wp-content\/uploads\/2020\/08\/Object-vs-Classes.jpg","width":659,"height":131,"caption":"Object vs Classes"},{"@type":"BreadcrumbList","@id":"https:\/\/kindsonthegenius.com\/cplusplus\/c-oop-basics\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kindsonthegenius.com\/cplusplus\/"},{"@type":"ListItem","position":2,"name":"C++ OOP &#8211; Basics"}]},{"@type":"WebSite","@id":"https:\/\/kindsonthegenius.com\/cplusplus\/#website","url":"https:\/\/kindsonthegenius.com\/cplusplus\/","name":"C++ Tutorials","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kindsonthegenius.com\/cplusplus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/kindsonthegenius.com\/cplusplus\/#\/schema\/person\/59a11a9f72bb132f56f91ab9f8a58a0e","name":"kindsonthegenius","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g","caption":"kindsonthegenius"},"url":"https:\/\/kindsonthegenius.com\/cplusplus\/author\/kindsonthegenius-3\/"}]}},"_links":{"self":[{"href":"https:\/\/kindsonthegenius.com\/cplusplus\/wp-json\/wp\/v2\/posts\/221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kindsonthegenius.com\/cplusplus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kindsonthegenius.com\/cplusplus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/cplusplus\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/cplusplus\/wp-json\/wp\/v2\/comments?post=221"}],"version-history":[{"count":1,"href":"https:\/\/kindsonthegenius.com\/cplusplus\/wp-json\/wp\/v2\/posts\/221\/revisions"}],"predecessor-version":[{"id":223,"href":"https:\/\/kindsonthegenius.com\/cplusplus\/wp-json\/wp\/v2\/posts\/221\/revisions\/223"}],"wp:attachment":[{"href":"https:\/\/kindsonthegenius.com\/cplusplus\/wp-json\/wp\/v2\/media?parent=221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/cplusplus\/wp-json\/wp\/v2\/categories?post=221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/cplusplus\/wp-json\/wp\/v2\/tags?post=221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}