{"id":45,"date":"2012-04-13T12:01:37","date_gmt":"2012-04-13T04:01:37","guid":{"rendered":"http:\/\/fishinbox.tk\/?p=45"},"modified":"2012-04-13T12:01:37","modified_gmt":"2012-04-13T04:01:37","slug":"dynamic-pointer-and-dynamic-memory-allocation-in-c","status":"publish","type":"post","link":"https:\/\/zhuangzr.me\/wordpress\/2012\/04\/dynamic-pointer-and-dynamic-memory-allocation-in-c\/","title":{"rendered":"Dynamic Pointer and Dynamic Memory Allocation in C++"},"content":{"rendered":"<p>Days ago a mate asked me a favor in his code and I got trouble in dynamic pointer and dynamic memory allocation.<br \/>\nWell, one-dimensional pointer is easy to use, and you can easily expand it&#8217;s occupied memory size by using realloc() as following:<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n#include &lt;iostream&gt;\nusing namespace std;\nint n=2,* pint;\nvoid Initialization()\n{\n\tpint=new int&#x5B;n];\n}\nvoid DoSomething(){}\nint main()\n{\n\tInitialization();\n\tDoSomething();\n\tpint=(int*)realloc(pint,(++n)*sizeof(int));\n\tpint&#x5B;n-1]=123456;\n\tcout&lt;&lt;pint&#x5B;n-1]&lt;&lt;endl;\n\treturn 0;\n}\n&lt;\/pre&gt;\nBut when it comes to the two-dimensional pointer, it nolonger works if you write some code like this:\n&lt;pre lang=&quot;cpp&quot; line=&quot;1&quot; file=&quot;code2.cpp&quot; colla=&quot;+&quot;&gt;\n#include &lt;iostream&gt;\nusing namespace std;\nint n=2,len=20;\nchar** ppchar;\nvoid Initialization(){\n\tppchar=new char*&#x5B;n];\n\tfor(int i=0;i&lt;n;i++){\n\t\tppchar&#x5B;i]=new char&#x5B;len];\n\t}\n}\nvoid DoSomething(){}\nint main()\n{\n\tInitialization();\n\tDoSomething();\n\tppchar=(char**)realloc(ppchar,(++n)*len*sizeof(char));\n\tppchar&#x5B;n-1]=&quot;this is a new one&quot;;\n\tcout&lt;&lt;ppchar&#x5B;n-1]&lt;&lt;endl;\n\treturn 0;\n}\n<\/pre>\n<p>That is because you failed to notify the system, or in other words declare the address of ppchar[n-1].<br \/>\nAnd here is a correct version of the same function by adding a statement between line 16 and 17:<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\nppchar&#x5B;n-1]=new char&#x5B;len];\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Days ago a mate asked me a favor in his code and I got trouble in dynamic pointer and dynamic memory allocation. Well, one-dimensional pointer is easy to use, and you can easily expand it&#8217;s occupied memory size by using realloc() as following: #include &lt;iostream&gt; using namespace std; int n=2,* pint; void Initialization() { pint=new &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/zhuangzr.me\/wordpress\/2012\/04\/dynamic-pointer-and-dynamic-memory-allocation-in-c\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Dynamic Pointer and Dynamic Memory Allocation in C++&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[25,41,44,63],"class_list":["post-45","post","type-post","status-publish","format-standard","hentry","category-cpp-programming","tag-c","tag-memory-allocation","tag-pointer","tag-programming"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"discussion on the Dynamic Pointer and Dynamic Memory Allocation in C++\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Hamilleton\"\/>\n\t<meta name=\"google-site-verification\" content=\"MU5z5UygVAc-wvTryHZh_Pyu9TTGhb65shw7AGmXpgE\" \/>\n\t<meta name=\"keywords\" content=\"dynamic pointer,dynamic memory allocation,c++,programming,c++,memory allocation,pointer,programming\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/zhuangzr.me\/wordpress\/2012\/04\/dynamic-pointer-and-dynamic-memory-allocation-in-c\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ZigZagRoad | Thoughts in Life and Research on Work\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Dynamic Pointer and Dynamic Memory Allocation in C++ | ZigZagRoad\" \/>\n\t\t<meta property=\"og:description\" content=\"discussion on the Dynamic Pointer and Dynamic Memory Allocation in C++\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/zhuangzr.me\/wordpress\/2012\/04\/dynamic-pointer-and-dynamic-memory-allocation-in-c\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/ziruizhuang.github.io\/assets\/img\/prof_pic.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/ziruizhuang.github.io\/assets\/img\/prof_pic.jpg\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2012-04-13T04:01:37+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2012-04-13T04:01:37+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Dynamic Pointer and Dynamic Memory Allocation in C++ | ZigZagRoad\" \/>\n\t\t<meta name=\"twitter:description\" content=\"discussion on the Dynamic Pointer and Dynamic Memory Allocation in C++\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/ziruizhuang.github.io\/assets\/img\/prof_pic.jpg\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/2012\\\/04\\\/dynamic-pointer-and-dynamic-memory-allocation-in-c\\\/#article\",\"name\":\"Dynamic Pointer and Dynamic Memory Allocation in C++ | ZigZagRoad\",\"headline\":\"Dynamic Pointer and Dynamic Memory Allocation in C++\",\"author\":{\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/author\\\/hamilleton\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/#person\"},\"datePublished\":\"2012-04-13T12:01:37+08:00\",\"dateModified\":\"2012-04-13T12:01:37+08:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/2012\\\/04\\\/dynamic-pointer-and-dynamic-memory-allocation-in-c\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/2012\\\/04\\\/dynamic-pointer-and-dynamic-memory-allocation-in-c\\\/#webpage\"},\"articleSection\":\"C++, C++, memory allocation, Pointer, Programming\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/2012\\\/04\\\/dynamic-pointer-and-dynamic-memory-allocation-in-c\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/#listItem\",\"name\":\"Study, Research and Work\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/#listItem\",\"position\":2,\"name\":\"Study, Research and Work\",\"item\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/#listItem\",\"name\":\"Computer Science\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/#listItem\",\"position\":3,\"name\":\"Computer Science\",\"item\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/programming\\\/#listItem\",\"name\":\"Programming\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/#listItem\",\"name\":\"Study, Research and Work\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/programming\\\/#listItem\",\"position\":4,\"name\":\"Programming\",\"item\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/programming\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/programming\\\/cpp-programming\\\/#listItem\",\"name\":\"C++\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/#listItem\",\"name\":\"Computer Science\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/programming\\\/cpp-programming\\\/#listItem\",\"position\":5,\"name\":\"C++\",\"item\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/programming\\\/cpp-programming\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/2012\\\/04\\\/dynamic-pointer-and-dynamic-memory-allocation-in-c\\\/#listItem\",\"name\":\"Dynamic Pointer and Dynamic Memory Allocation in C++\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/programming\\\/#listItem\",\"name\":\"Programming\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/2012\\\/04\\\/dynamic-pointer-and-dynamic-memory-allocation-in-c\\\/#listItem\",\"position\":6,\"name\":\"Dynamic Pointer and Dynamic Memory Allocation in C++\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/programming\\\/cpp-programming\\\/#listItem\",\"name\":\"C++\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/#person\",\"name\":\"Hamilleton\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/author\\\/hamilleton\\\/#author\",\"url\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/author\\\/hamilleton\\\/\",\"name\":\"Hamilleton\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/2012\\\/04\\\/dynamic-pointer-and-dynamic-memory-allocation-in-c\\\/#webpage\",\"url\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/2012\\\/04\\\/dynamic-pointer-and-dynamic-memory-allocation-in-c\\\/\",\"name\":\"Dynamic Pointer and Dynamic Memory Allocation in C++ | ZigZagRoad\",\"description\":\"discussion on the Dynamic Pointer and Dynamic Memory Allocation in C++\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/2012\\\/04\\\/dynamic-pointer-and-dynamic-memory-allocation-in-c\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/author\\\/hamilleton\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/author\\\/hamilleton\\\/#author\"},\"datePublished\":\"2012-04-13T12:01:37+08:00\",\"dateModified\":\"2012-04-13T12:01:37+08:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/#website\",\"url\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/\",\"name\":\"ZigZagRoad\",\"description\":\"Thoughts in Life and Research on Work\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Dynamic Pointer and Dynamic Memory Allocation in C++ | ZigZagRoad","description":"discussion on the Dynamic Pointer and Dynamic Memory Allocation in C++","canonical_url":"https:\/\/zhuangzr.me\/wordpress\/2012\/04\/dynamic-pointer-and-dynamic-memory-allocation-in-c\/","robots":"max-image-preview:large","keywords":"dynamic pointer,dynamic memory allocation,c++,programming,c++,memory allocation,pointer,programming","webmasterTools":{"google-site-verification":"MU5z5UygVAc-wvTryHZh_Pyu9TTGhb65shw7AGmXpgE","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/zhuangzr.me\/wordpress\/2012\/04\/dynamic-pointer-and-dynamic-memory-allocation-in-c\/#article","name":"Dynamic Pointer and Dynamic Memory Allocation in C++ | ZigZagRoad","headline":"Dynamic Pointer and Dynamic Memory Allocation in C++","author":{"@id":"https:\/\/zhuangzr.me\/wordpress\/author\/hamilleton\/#author"},"publisher":{"@id":"https:\/\/zhuangzr.me\/wordpress\/#person"},"datePublished":"2012-04-13T12:01:37+08:00","dateModified":"2012-04-13T12:01:37+08:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/zhuangzr.me\/wordpress\/2012\/04\/dynamic-pointer-and-dynamic-memory-allocation-in-c\/#webpage"},"isPartOf":{"@id":"https:\/\/zhuangzr.me\/wordpress\/2012\/04\/dynamic-pointer-and-dynamic-memory-allocation-in-c\/#webpage"},"articleSection":"C++, C++, memory allocation, Pointer, Programming"},{"@type":"BreadcrumbList","@id":"https:\/\/zhuangzr.me\/wordpress\/2012\/04\/dynamic-pointer-and-dynamic-memory-allocation-in-c\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress#listItem","position":1,"name":"Home","item":"https:\/\/zhuangzr.me\/wordpress","nextItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/#listItem","name":"Study, Research and Work"}},{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/#listItem","position":2,"name":"Study, Research and Work","item":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/","nextItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/#listItem","name":"Computer Science"},"previousItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/#listItem","position":3,"name":"Computer Science","item":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/","nextItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/#listItem","name":"Programming"},"previousItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/#listItem","name":"Study, Research and Work"}},{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/#listItem","position":4,"name":"Programming","item":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/","nextItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/cpp-programming\/#listItem","name":"C++"},"previousItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/#listItem","name":"Computer Science"}},{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/cpp-programming\/#listItem","position":5,"name":"C++","item":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/cpp-programming\/","nextItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/2012\/04\/dynamic-pointer-and-dynamic-memory-allocation-in-c\/#listItem","name":"Dynamic Pointer and Dynamic Memory Allocation in C++"},"previousItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/#listItem","name":"Programming"}},{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/2012\/04\/dynamic-pointer-and-dynamic-memory-allocation-in-c\/#listItem","position":6,"name":"Dynamic Pointer and Dynamic Memory Allocation in C++","previousItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/cpp-programming\/#listItem","name":"C++"}}]},{"@type":"Person","@id":"https:\/\/zhuangzr.me\/wordpress\/#person","name":"Hamilleton"},{"@type":"Person","@id":"https:\/\/zhuangzr.me\/wordpress\/author\/hamilleton\/#author","url":"https:\/\/zhuangzr.me\/wordpress\/author\/hamilleton\/","name":"Hamilleton"},{"@type":"WebPage","@id":"https:\/\/zhuangzr.me\/wordpress\/2012\/04\/dynamic-pointer-and-dynamic-memory-allocation-in-c\/#webpage","url":"https:\/\/zhuangzr.me\/wordpress\/2012\/04\/dynamic-pointer-and-dynamic-memory-allocation-in-c\/","name":"Dynamic Pointer and Dynamic Memory Allocation in C++ | ZigZagRoad","description":"discussion on the Dynamic Pointer and Dynamic Memory Allocation in C++","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/zhuangzr.me\/wordpress\/#website"},"breadcrumb":{"@id":"https:\/\/zhuangzr.me\/wordpress\/2012\/04\/dynamic-pointer-and-dynamic-memory-allocation-in-c\/#breadcrumblist"},"author":{"@id":"https:\/\/zhuangzr.me\/wordpress\/author\/hamilleton\/#author"},"creator":{"@id":"https:\/\/zhuangzr.me\/wordpress\/author\/hamilleton\/#author"},"datePublished":"2012-04-13T12:01:37+08:00","dateModified":"2012-04-13T12:01:37+08:00"},{"@type":"WebSite","@id":"https:\/\/zhuangzr.me\/wordpress\/#website","url":"https:\/\/zhuangzr.me\/wordpress\/","name":"ZigZagRoad","description":"Thoughts in Life and Research on Work","inLanguage":"en-US","publisher":{"@id":"https:\/\/zhuangzr.me\/wordpress\/#person"}}]},"og:locale":"en_US","og:site_name":"ZigZagRoad | Thoughts in Life and Research on Work","og:type":"article","og:title":"Dynamic Pointer and Dynamic Memory Allocation in C++ | ZigZagRoad","og:description":"discussion on the Dynamic Pointer and Dynamic Memory Allocation in C++","og:url":"https:\/\/zhuangzr.me\/wordpress\/2012\/04\/dynamic-pointer-and-dynamic-memory-allocation-in-c\/","og:image":"https:\/\/ziruizhuang.github.io\/assets\/img\/prof_pic.jpg","og:image:secure_url":"https:\/\/ziruizhuang.github.io\/assets\/img\/prof_pic.jpg","article:published_time":"2012-04-13T04:01:37+00:00","article:modified_time":"2012-04-13T04:01:37+00:00","twitter:card":"summary","twitter:title":"Dynamic Pointer and Dynamic Memory Allocation in C++ | ZigZagRoad","twitter:description":"discussion on the Dynamic Pointer and Dynamic Memory Allocation in C++","twitter:image":"https:\/\/ziruizhuang.github.io\/assets\/img\/prof_pic.jpg"},"aioseo_meta_data":{"post_id":"45","title":"Dynamic Pointer and Dynamic Memory Allocation in C++  | #site_title","description":"discussion on the Dynamic Pointer and Dynamic Memory Allocation in C++","keywords":[{"label":"Dynamic Pointer,Dynamic Memory Allocation,C++,programming","value":"Dynamic Pointer,Dynamic Memory Allocation,C++,programming"}],"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[],"defaultGraph":"","defaultPostTypeGraph":""},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2020-12-24 07:00:03","updated":"2025-07-03 08:44:20","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/zhuangzr.me\/wordpress\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/\" title=\"Study, Research and Work\">Study, Research and Work<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/\" title=\"Computer Science\">Computer Science<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/\" title=\"Programming\">Programming<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/cpp-programming\/\" title=\"C++\">C++<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tDynamic Pointer and Dynamic Memory Allocation in C++\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/zhuangzr.me\/wordpress"},{"label":"Study, Research and Work","link":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/"},{"label":"Computer Science","link":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/"},{"label":"Programming","link":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/"},{"label":"C++","link":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/cpp-programming\/"},{"label":"Dynamic Pointer and Dynamic Memory Allocation in C++","link":"https:\/\/zhuangzr.me\/wordpress\/2012\/04\/dynamic-pointer-and-dynamic-memory-allocation-in-c\/"}],"_links":{"self":[{"href":"https:\/\/zhuangzr.me\/wordpress\/wp-json\/wp\/v2\/posts\/45","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zhuangzr.me\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zhuangzr.me\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zhuangzr.me\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zhuangzr.me\/wordpress\/wp-json\/wp\/v2\/comments?post=45"}],"version-history":[{"count":0,"href":"https:\/\/zhuangzr.me\/wordpress\/wp-json\/wp\/v2\/posts\/45\/revisions"}],"wp:attachment":[{"href":"https:\/\/zhuangzr.me\/wordpress\/wp-json\/wp\/v2\/media?parent=45"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zhuangzr.me\/wordpress\/wp-json\/wp\/v2\/categories?post=45"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zhuangzr.me\/wordpress\/wp-json\/wp\/v2\/tags?post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}