{"id":2423,"date":"2011-02-01T00:59:18","date_gmt":"2011-01-31T16:59:18","guid":{"rendered":"http:\/\/edsionte.com\/techblog\/?p=2423"},"modified":"2011-02-08T16:54:54","modified_gmt":"2011-02-08T08:54:54","slug":"%e6%8c%87%e9%92%88%e5%92%8c%e6%95%b0%e7%bb%84%e6%98%af%e4%b8%8d%e5%90%8c%e7%9a%84%ef%bc%81","status":"publish","type":"post","link":"http:\/\/edsionte.com\/techblog\/archives\/2423","title":{"rendered":"\u6307\u9488\u548c\u6570\u7ec4\u7684\u5185\u5b58\u6784\u9020"},"content":{"rendered":"<p>\u6307\u9488\u548c\u6570\u7ec4\u662f\u4e0d\u76f8\u540c\u7684\uff0c\u4f46\u201c\u5f88\u591a\u65f6\u5019\u201d\u6211\u4eec\u603b\u8ba4\u4e3a\u6307\u9488\u548c\u6570\u7ec4\u7b49\u4ef7\u7684\u3002\u4e0d\u53ef\u5426\u8ba4\uff0c\u8fd9\u4e24\u8005\u5728\u67d0\u79cd\u60c5\u51b5\u4e0b\u662f\u53ef\u4ee5\u76f8\u4e92\u66ff\u6362\u7684\uff0c\u4f46\u5e76\u4e0d\u80fd\u5c31\u56e0\u6b64\u800c\u8ba4\u4e3a\u5728\u6240\u6709\u60c5\u51b5\u4e0b\u90fd\u9002\u5408\u3002\u300a\u6307\u9488\u548c\u6570\u7ec4\u4e0d\u662f\u4e00\u56de\u4e8b\u513f\u300b\u7cfb\u5217\u6587\u7ae0\u5c06\u9010\u6b65\u6df1\u5165\u5206\u6790\u6307\u9488\u548c\u6570\u7ec4\u7684\u4e0d\u540c\u4e4b\u5904\uff0c\u5e76\u89e3\u91ca\u4ec0\u4e48\u65f6\u5019\u6307\u6570\u7ec4\u7b49\u4ef7\u4e8e\u6307\u9488\u3002<strong>\u672c\u6587\u5c5e\u4e8e\u300a\u6307\u9488\u548c\u6570\u7ec4\u4e0d\u662f\u4e00\u56de\u4e8b\u513f\u300b\u7cfb\u5217\u6587\u7ae0\u4e4b\u4e00\u3002<\/strong><\/p>\n<p><strong><\/strong>\u6307\u9488\u548c\u6570\u7ec4\u7684\u672c\u8d28\u662f\u4ec0\u4e48\uff0c\u8fd9\u662f\u672c\u6587\u8ba8\u8bba\u7684\u91cd\u70b9\u3002\u4ece\u5185\u5b58\u7ed3\u6784\u7684\u89d2\u5ea6\u6765\u8bf4\uff0c\u4e24\u8005\u662f\u622a\u7136\u4e0d\u540c\u7684\u4e24\u4e2a\u6982\u5ff5\u3002<\/p>\n<h3>\u6570\u7ec4\u7684\u58f0\u660e\u4e0e\u5b9a\u4e49<\/h3>\n<p>\u5173\u4e8eC\u8bed\u8a00\u4e2d\u7684\u58f0\u660e\uff0c<a href=\"http:\/\/edsionte.com\/techblog\/archives\/2350\" target=\"_blank\">\u300a\u58f0\u660e\u90a3\u56de\u4e8b\u513f\u300b<\/a>\u4e00\u6587\u4e2d\u5df2\u8be6\u7ec6\u53d9\u8ff0\u3002\u8fd9\u91cc\u518d\u5177\u4f53\u9488\u5bf9\u6570\u7ec4\u7684\u5b9a\u4e49\u548c\u58f0\u660e\u505a\u4ee5\u5206\u6790\u3002\u4ee5\u4e0b\u9762\u7684\u58f0\u660e\u4ee3\u7801\u4e3a\u4f8b\uff1a<\/p>\n<pre class=\"brush:c\">char str[10];\r\nextern char str[];<\/pre>\n<p>\u7b2c\u4e00\u6761\u58f0\u660e\u8bed\u53e5\u5b9a\u4e49\u4e86\u4e00\u4e2achar\u578b\u7684\u6570\u7ec4\uff0c\u5e76\u4e3a\u5176\u5206\u914d\u4e86100\u5b57\u8282\u5927\u5c0f\u7684\u5185\u5b58\u7a7a\u95f4\u3002\u800c\u7b2c\u4e8c\u6761\u58f0\u660e\u8bed\u53e5\u5219\u662f\u4e3a\u4e86\u544a\u8bc9\u7f16\u8bd1\u5668\u8fd9\u4e2a\u6570\u7ec4\u7684\u7c7b\u578b\u4ee5\u53ca\u5927\u5c0f\u3002\u7531\u4e8e\u5728\u5916\u90e8\u5f15\u7528\u578b\u58f0\u660e\u4e2d\u5e76\u4e0d\u4f1a\u6570\u7ec4\u5206\u914d\u5185\u5b58\u7a7a\u95f4\uff0c\u56e0\u6b64\u8fd9\u79cd\u58f0\u660e\u5e76\u4e0d\u9700\u8981\u6307\u5b9a\u6570\u7ec4\u7684\u5927\u5c0f\u3002\u5bf9\u4e8e\u591a\u7ef4\u6570\u7ec4\u4e5f\u5e76\u4e0d\u9700\u8981\u6307\u5b9a\u7b2c\u4e00\u7ef4\u7684\u5927\u5c0f\u3002<\/p>\n<h3>\u6307\u9488\u7684\u5185\u5b58\u5e03\u5c40<\/h3>\n<p>\u6307\u9488\u672c\u8d28\u4e0a\u5c31\u662f\u4e00\u4e2a\u5185\u5b58\u5730\u5740\uff0c\u4e3a\u4e86\u65b9\u4fbf\u4f7f\u7528\u8fd9\u4e2a\u5185\u5b58\u5730\u5740\u5c06\u5b83\u548c\u4e00\u4e2a\u6807\u793a\u7b26\u7ed1\u5b9a\u5728\u4e00\u8d77\u3002\u6bd4\u5982\uff1a<\/p>\n<pre class=\"brush:c\">int i = 10;\r\nint *p = &amp;i; \/* \u5047\u8bbe\u53d8\u91cfi\u7684\u5185\u5b58\u5730\u5740\u4e3a0x000F3E00 *\/<\/pre>\n<p>\u4e0a\u8ff0\u8bed\u53e5\u5c06\u5730\u57400x000F3E00\u548cp\u7ed1\u5b9a\u5728\u4e00\u8d77\uff0c\u5e76\u4e14\u4e00\u65e6\u7ed1\u5b9a\u5c31\u4e0d\u80fd\u518d\u4fee\u6539\uff0cp\u6b64\u65f6\u4e5f\u88ab\u79f0\u4e3a\u6307\u9488\u53d8\u91cf\uff0c\u7b80\u79f0\u6307\u9488\u3002\u201c\u6307\u9488\u53d8\u91cf\u201c\u4e2d\u7684\u201c\u53d8\u91cf\u201d\u5e76\u4e0d\u662f\u8bf4\u660ep\u53ef\u4ee5\u518d\u548c\u5176\u4ed6\u5730\u5740\u7ed1\u5b9a\uff0c\u800c\u662f\u5f3a\u8c03\u4e0ep\u7ed1\u5b9a\u7684\u8fd9\u4e2a\u5730\u5740\u4e2d\u7684\u5185\u5bb9\u53ef\u53d8\uff0c\u5373i\u7684\u503c\u53ef\u4ee5\u53d8\u5316\u3002<\/p>\n<p>\u65e2\u7136\u6307\u9488p\u662f\u4e00\u4e2a\u5185\u5b58\u5730\u5740\uff0c\u90a3\u4e48\u572832\u4f4d\u7684\u7cfb\u7edf\u4e2d\u6307\u9488p\u6240\u5360\u7684\u5185\u5b58\u5927\u5c0f\u5c31\u59cb\u7ec8\u4e3a4\u5b57\u8282\u3002\u867d\u7136\u6574\u578b\u53d8\u91cfi\u4e5f\u53604\u5b57\u8282\uff0c\u4f46\u662f\u8fd9\u4e24\u4e2a\u540c\u5927\u5c0f\u7684\u5185\u5b58\u7a7a\u95f4\u5374\u6709\u7740\u672c\u8d28\u533a\u522b\u3002\u6307\u9488p\u53ea\u80fd\u5b58\u653e\u5185\u5b58\u5730\u5740\uff0c\u5e76\u4e14\u8fd9\u4e2a\u5730\u5740\u53ea\u80fd\u662f\u6574\u578b\u6570\u636e\u7684\u9996\u5730\u5740\u3002\u5373\u4f7f\u5728p\u5185\u5b58\u653e\u4e86\u5176\u4ed6\u6570\u636e\uff0c\u4e5f\u4f1a\u4e00\u5f8b\u88ab\u5f53\u4f5c\u5185\u5b58\u5730\u5740\u6765\u5904\u7406\u3002<\/p>\n<p>\u901a\u8fc7\u4e0b\u56fe\u53ef\u4ee5\u8fd1\u4e00\u6b65\u4e86\u89e3\u6307\u9488\u548c\u5176\u6240\u6307\u6570\u636e\u7684\u5173\u7cfb\uff1a<\/p>\n<p><a rel=\"attachment wp-att-2445\" href=\"http:\/\/edsionte.com\/techblog\/archives\/2423\/screenshot-6\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2445\" title=\"Screenshot\" src=\"http:\/\/edsionte.com\/techblog\/wordpress\/wp-content\/uploads\/2011\/02\/Screenshot.png\" alt=\"\" width=\"559\" height=\"225\" srcset=\"http:\/\/edsionte.com\/techblog\/wordpress\/wp-content\/uploads\/2011\/02\/Screenshot.png 559w, http:\/\/edsionte.com\/techblog\/wordpress\/wp-content\/uploads\/2011\/02\/Screenshot-300x120.png 300w\" sizes=\"auto, (max-width: 559px) 100vw, 559px\" \/><\/a><br \/>\n\u4ece\u56fe\u4e2d\u53ef\u5f97\u77e5\uff0c\u4e0d\u7ba1\u6307\u9488\u6240\u6307\u6570\u636e\u5360\u591a\u5927\u7684\u5185\u5b58\u7a7a\u95f4\uff0c\u6307\u9488\u672c\u8eab\u53ea\u5360\u75284\u5b57\u8282\u7684\u5927\u5c0f\u3002\u7531\u4e8e\u6307\u9488p\u672c\u8eab\u5360\u75284\u5b57\u8282\u7684\u5185\u5b58\u7a7a\u95f4\uff0c\u56e0\u6b64\u8fd9\u90e8\u5206\u5185\u5b58\u7a7a\u95f4\u4e5f\u5fc5\u7136\u4f1a\u6709\u9996\u5730\u5740\u3002\u901a\u8fc7&amp;p\u64cd\u4f5c\u5c31\u53ef\u4ee5\u5f97\u5230\u6307\u9488p\u7684\u9996\u5730\u5740\uff0c\u4e5f\u5c31\u662f\u5b58\u50a8\u6307\u9488p\u7684\u5185\u5b58\u7a7a\u95f4\u7684\u9996\u5730\u5740\u3002\u4ece\u4e0a\u56fe\u4e2d\u53ef\u4ee5\u770b\u5230\u6307\u9488p\u4e2d\u5373\u4e3a\u6574\u578b\u53d8\u91cfi\u7684\u9996\u5730\u5740\uff0c\u56e0\u6b64\u6211\u4eec\u4e5f\u79f0p\u662f\u4e00\u4e2a\u6307\u5411\u6574\u578b\u53d8\u91cfi\u7684\u6307\u9488\u3002<\/p>\n<h3>\u6570\u7ec4\u7684\u5185\u5b58\u5e03\u5c40<\/h3>\n<p>\u6570\u7ec4\u662f\u4e00\u5757\u8fde\u7eed\u7684\u5185\u5b58\u7a7a\u95f4\uff0c\u8fd9\u5757\u5185\u5b58\u7a7a\u95f4\u7684\u540d\u79f0\u5373\u4e3a\u6570\u7ec4\u540d\u3002\u6bd4\u5982\uff1a<\/p>\n<pre class=\"brush:c\">int a[100];<\/pre>\n<p>\u5f53\u5b9a\u4e49\u4e86\u4e00\u4e2a\u5177\u4f53\u7684\u6570\u7ec4a\u65f6\uff0c\u7f16\u8bd1\u5668\u5c31\u6839\u636e\u6570\u636e\u7c7b\u578b\u548c\u5927\u5c0f\u4e3a\u5176\u5206\u914d100*sizeof(int)\u5927\u5c0f\u7684\u5185\u5b58\u7a7a\u95f4\uff0c\u5e76\u5c06\u8fd9\u5757\u8fde\u7eed\u7684\u5185\u5b58\u7a7a\u95f4\u547d\u540d\u4e3aa\u3002\u867d\u7136\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7a[i]\u8fd9\u79cd\u65b9\u5f0f\u6765\u8bbf\u95ee\u5143\u7d20i\uff0c\u4f46\u8fd9\u5e76\u4e0d\u4ee3\u8868a[i]\u5c31\u662f\u8fd9\u4e2a\u5143\u7d20\u7684\u540d\u79f0\u3002\u56e0\u6b64\u6bcf\u4e2a\u6570\u7ec4\u5143\u7d20\u5b9e\u9645\u4e0a\u662f\u6ca1\u6709\u540d\u5b57\u7684\uff0c\u7f16\u8bd1\u5668\u53ea\u4e3a\u8fd9\u5757\u5185\u5b58\u63d0\u4f9b\u4e86\u552f\u4e00\u7684\u540d\u79f0a\u3002\u540c\u65f6\u6570\u7ec4\u540da\u4e5f\u4ee3\u8868\u6570\u7ec4\u9996\u5143\u7d20\u7684\u9996\u5730\u5740\u3002\u6570\u7ec4\u7684\u5185\u5b58\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n<p><a rel=\"attachment wp-att-2458\" href=\"http:\/\/edsionte.com\/techblog\/archives\/2423\/array\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2458\" title=\"array\" src=\"http:\/\/edsionte.com\/techblog\/wordpress\/wp-content\/uploads\/2011\/02\/array.jpeg\" alt=\"\" width=\"350\" height=\"220\" srcset=\"http:\/\/edsionte.com\/techblog\/wordpress\/wp-content\/uploads\/2011\/02\/array.jpeg 350w, http:\/\/edsionte.com\/techblog\/wordpress\/wp-content\/uploads\/2011\/02\/array-300x188.jpg 300w\" sizes=\"auto, (max-width: 350px) 100vw, 350px\" \/><\/a><br \/>\n\u901a\u8fc7\u5bf9\u6307\u9488\u548c\u6570\u7ec4\u5185\u5b58\u5e03\u5c40\u7684\u5206\u6790\uff0c\u6211\u4eec\u53ef\u4ee5\u5f97\u77e5\u8fd9\u4e24\u8005\u5b8c\u5168\u662f\u4e0d\u76f8\u540c\u7684\u3002\u6307\u9488\u4e0d\u7ba1\u6307\u5411\u4ec0\u4e48\u6570\u636e\uff0c\u5b83\u672c\u8eab\u7684\u5927\u5c0f\u5c31\u662f4\u4e2a\u5b57\u8282\uff0832\u4f4d\u7cfb\u7edf\uff09\uff1b\u800c\u6570\u7ec4\u5219\u662f\u4e00\u5757\u8fde\u7eed\u7684\u5185\u5b58\u7a7a\u95f4\u3002\u5728\u4e0b\u6587\u4e2d\uff0c\u5c06\u4f1a\u4ece\u8bbf\u95ee\u65b9\u5f0f\u7684\u89d2\u5ea6\u5206\u6790\u6307\u9488\u548c\u6570\u7ec4\u7684\u4e0d\u540c\u3002<\/p>\n<p><strong>\u53c2\u8003\uff1a<\/strong><\/p>\n<p><strong>\u300aC\u4e13\u5bb6\u7f16\u7a0b\u300b \u4eba\u6c11\u90ae\u7535\u51fa\u7248\u793e\uff1b\uff08\u7f8e\uff09\u6797\u767b\uff08LinDen.P.V.D\uff09 \u8457\uff0c\u5f90\u6ce2 \u8bd1\uff1b<\/strong><\/p>\n<p><strong>\u300aC\u8bed\u8a00\u6df1\u5ea6\u89e3\u5256\u300b\u5317\u4eac\u822a\u7a7a\u822a\u5929\u5927\u5b66\u51fa\u7248\u793e\uff1b\u9648\u6b63\u51b2 \u8457\uff1b<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6307\u9488\u548c\u6570\u7ec4\u662f\u4e0d\u76f8\u540c\u7684\uff0c\u4f46\u201c\u5f88\u591a\u65f6\u5019\u201d\u6211\u4eec\u603b\u8ba4\u4e3a\u6307\u9488\u548c\u6570\u7ec4\u7b49\u4ef7\u7684\u3002\u4e0d\u53ef\u5426\u8ba4\uff0c\u8fd9\u4e24\u8005\u5728\u67d0\u79cd\u60c5\u51b5\u4e0b\u662f\u53ef\u4ee5\u76f8\u4e92\u66ff\u6362\u7684\uff0c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[74],"tags":[109,401,165,166],"class_list":{"0":"post-2423","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-c","7":"tag-c","9":"tag-165","10":"tag-166"},"views":9359,"_links":{"self":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts\/2423","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/comments?post=2423"}],"version-history":[{"count":0,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts\/2423\/revisions"}],"wp:attachment":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/media?parent=2423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/categories?post=2423"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/tags?post=2423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}