{"id":4048,"date":"2021-07-05T12:04:42","date_gmt":"2021-07-05T04:04:42","guid":{"rendered":"http:\/\/blog.coolcoding.cn\/?p=4048"},"modified":"2021-07-05T12:12:45","modified_gmt":"2021-07-05T04:12:45","slug":"const%e7%9a%84%e5%87%a0%e7%a7%8d%e5%86%99%e6%b3%95","status":"publish","type":"post","link":"https:\/\/blog.coolcoding.cn\/?p=4048","title":{"rendered":"[c]const\u7684\u51e0\u79cd\u5199\u6cd5"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>\u4e00\u3001\u4fee\u9970\u53d8\u91cf\nconst char* p1 = 0; \/\/ \u5185\u5bb9\u4e0d\u53ef\u6539\uff0c\u6307\u9488\u53ef\u6539\nchar* const p2 = 0; \/\/ \u5185\u5bb9\u53ef\u6539\uff0c\u6307\u9488\u4e0d\u53ef\u6539\nconst char* const p3 = 0; \/\/ \u5185\u5bb9\u548c\u6307\u9488\u5747\u4e0d\u53ef\u6539\nchar const* p1b = 0; \/\/ \u7b49\u540c\u4e8ep1\nchar const* const p3b = 0; \/\/ \u7b49\u540c\u4e8ep3\np1 = p2; \/\/ ok\np1[0] = 0; \/\/ fail\np2[0] = 0; \/\/ ok\np2 = p1; \/\/ fail\np3 = p1; \/\/ fail\np3[0] = 0; \/\/ fail\n\n\u4e8c\u3001\u4fee\u9970\u51fd\u6570\u8fd4\u56de\u503c<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/4048"}],"collection":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4048"}],"version-history":[{"count":3,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/4048\/revisions"}],"predecessor-version":[{"id":4052,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/4048\/revisions\/4052"}],"wp:attachment":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}