{"id":146,"date":"2006-10-26T00:52:57","date_gmt":"2006-10-25T22:52:57","guid":{"rendered":"http:\/\/mattiesworld.gotdns.org\/weblog\/2006\/10\/26\/c-const-rule-or-rule-the-const\/"},"modified":"2006-10-26T00:52:57","modified_gmt":"2006-10-25T22:52:57","slug":"c-const-rule-or-rule-the-const","status":"publish","type":"post","link":"https:\/\/mattiesworld.gotdns.org\/weblog\/2006\/10\/26\/c-const-rule-or-rule-the-const\/","title":{"rendered":"C++: Const rule (or rule the const)"},"content":{"rendered":"<p>how about:<\/p>\n<ol>\n<li>const char *<\/li>\n<li>char const *<\/li>\n<li>char * const<\/li>\n<\/ol>\n<p><em>&#8220;const applies to what is on its left&#8221;<\/em><br \/>\nSo 1 and 2 are the same, they both point to fixed text with variable pointer. 3 has fixed pointer with variable text. If const is first, move it one token to the right.<\/p>\n<p>this is just a reminder for myself \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>how about: const char * char const * char * const &#8220;const applies to what is on its left&#8221; So 1 and 2 are the same, they both point to fixed text with variable pointer. 3 has fixed pointer with variable text. If const is first, move it one token to the right. this is &hellip; <a href=\"https:\/\/mattiesworld.gotdns.org\/weblog\/2006\/10\/26\/c-const-rule-or-rule-the-const\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">C++: Const rule (or rule the const)<\/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":[5],"tags":[],"class_list":["post-146","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/posts\/146","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/comments?post=146"}],"version-history":[{"count":0,"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/posts\/146\/revisions"}],"wp:attachment":[{"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/media?parent=146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/categories?post=146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/tags?post=146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}