{"id":3409,"date":"2020-08-05T14:36:42","date_gmt":"2020-08-05T14:36:42","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=3409"},"modified":"2020-08-05T14:37:52","modified_gmt":"2020-08-05T14:37:52","slug":"class-copy","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/programming-in-c\/classes\/class-copy","title":{"rendered":"Class Copy"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Copy Constructor in C++<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">Class Copy Constructor<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>\t\/\/***** COPY CONSTRUCTOR *****\n\tMyClassName (const MyClassName &amp;CopyFrom)\n\t{\n\t\tMyVariableA = CopyFrom.MyVariableA;\n\t\tMyVariableB = CopyFrom.MyVariableB;\n\t}<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Using the copy constructor<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>\t\/\/Using the copy constructor\n\tMyClassName MyClass1();\t\t\t\t\/\/Create an instance of the class as normal\n\tMyClassName1.MyVariableA = 12;\n\tMyClassName1.MyVariableB = 34;\n\t\n\tMyClassName MyClass2 = MyClass1;\t\/\/Copy constructor is called here <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Copy Constructor in C++ Class Copy Constructor Using the copy constructor<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70],"tags":[],"class_list":["post-3409","post","type-post","status-publish","format-standard","hentry","category-classes"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3409","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=3409"}],"version-history":[{"count":3,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3409\/revisions"}],"predecessor-version":[{"id":3412,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3409\/revisions\/3412"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=3409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=3409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=3409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}