{"id":42007,"date":"2023-09-27T18:49:38","date_gmt":"2023-09-27T10:49:38","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=42007"},"modified":"2024-03-27T17:35:00","modified_gmt":"2024-03-27T09:35:00","slug":"alyzzsxdsf","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/42007.html","title":{"rendered":"ABPLC\u5229\u7528\u6307\u9488\u5b9e\u73b0\u7684\u7b97\u6cd5"},"content":{"rendered":"
\u6307\u9488\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u53d8\u91cf\uff0c\u5b83\u53ef\u4ee5\u5b58\u50a8\u4e00\u4e2a\u53d8\u91cf\u7684\u5730\u5740\uff0c\u4ece\u800c\u4f7f\u7a0b\u5e8f\u53ef\u4ee5\u76f4\u63a5\u8bbf\u95ee\u53d8\u91cf\u7684\u5185\u5b58\u5730\u5740\u3002ABPLC\u5229\u7528\u6307\u9488\u5b9e\u73b0\u7684\u7b97\u6cd5\u53ef\u4ee5\u6781\u5927\u5730\u63d0\u9ad8\u8ba1\u7b97\u673a\u7a0b\u5e8f\u7684\u6267\u884c\u6548\u7387\uff0c\u540c\u65f6\u4e5f\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u66f4\u597d\u5730\u63a7\u5236\u7a0b\u5e8f\u7684\u6267\u884c\u6d41\u7a0b\u3002\u672c\u6587\u5c06\u4ecb\u7ecdABPLC\u5229\u7528\u6307\u9488\u5b9e\u73b0\u7684\u7b97\u6cd5\u7684\u57fa\u672c\u539f\u7406\uff0c\u5e76\u4e14\u4ecb\u7ecd\u51e0\u79cd\u5e38\u89c1\u7684\u6307\u9488\u64cd\u4f5c\u65b9\u6cd5\u3002<\/p>\n
ABPLC\u5229\u7528\u6307\u9488\u5b9e\u73b0\u7684\u7b97\u6cd5\u662f\u4e00\u79cd\u975e\u5e38\u6709\u6548\u7684\u7b97\u6cd5\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u7a0b\u5e8f\u5458\u66f4\u5feb\u5730\u5b9e\u73b0\u7a0b\u5e8f\u7684\u529f\u80fd\u3002\u6307\u9488\u53ef\u4ee5\u8ba9\u7a0b\u5e8f\u5458\u76f4\u63a5\u8bbf\u95ee\u5b58\u50a8\u5728\u5185\u5b58\u4e2d\u7684\u6570\u636e\uff0c\u8fd9\u6837\u53ef\u4ee5\u6781\u5927\u5730\u63d0\u9ad8\u7a0b\u5e8f\u7684\u8fd0\u884c\u6548\u7387\u3002\u6b64\u5916\uff0c\u6307\u9488\u8fd8\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u66f4\u597d\u5730\u63a7\u5236\u7a0b\u5e8f\u7684\u6267\u884c\u6d41\u7a0b\uff0c\u4ece\u800c\u51cf\u5c11\u7a0b\u5e8f\u7684\u6267\u884c\u65f6\u95f4\u3002<\/p>\n
\u5728\u4f7f\u7528\u6307\u9488\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u5b9a\u4e49\u4e00\u4e2a\u6307\u9488\u53d8\u91cf\u3002\u6307\u9488\u53d8\u91cf\u7684\u5b9a\u4e49\u65b9\u6cd5\u4e0e\u666e\u901a\u53d8\u91cf\u7684\u5b9a\u4e49\u65b9\u6cd5\u4e00\u81f4\uff0c\u53ea\u662f\u9700\u8981\u5728\u53d8\u91cf\u7c7b\u578b\u524d\u52a0\u4e0a\u4e00\u4e2a\u661f\u53f7\uff08*\uff09\uff0c\u8868\u793a\u8fd9\u662f\u4e00\u4e2a\u6307\u9488\u53d8\u91cf\u3002\u4f8b\u5982\uff1a<\/p>\n
int *p;<\/code><\/pre>\n \u4e0a\u9762\u7684\u4ee3\u7801\u5b9a\u4e49\u4e86\u4e00\u4e2a\u6307\u5411\u6574\u578b\u53d8\u91cf\u7684\u6307\u9488\u53d8\u91cfp\u3002<\/p>\n
2.\u53d6\u5740\u64cd\u4f5c<\/h3>\n
\u53d6\u5740\u64cd\u4f5c\u662f\u6307\u9488\u64cd\u4f5c\u4e2d\u6700\u57fa\u672c\u7684\u64cd\u4f5c\uff0c\u5b83\u53ef\u4ee5\u8ba9\u6307\u9488\u53d8\u91cf\u5b58\u50a8\u67d0\u4e2a\u53d8\u91cf\u7684\u5730\u5740\u3002\u53d6\u5740\u64cd\u4f5c\u7684\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n
\u6307\u9488\u53d8\u91cf = &\u53d8\u91cf\u540d;<\/code><\/pre>\n \u4f8b\u5982\uff1a<\/p>\n
int a = 10; int *p;<\/p> p = &a;<\/code><\/pre>\n
\u4e0a\u9762\u7684\u4ee3\u7801\u5b9a\u4e49\u4e86\u4e00\u4e2a\u6574\u578b\u53d8\u91cfa\uff0c\u5e76\u5c06\u5b83\u7684\u5730\u5740\u5b58\u50a8\u5230\u6307\u9488\u53d8\u91cfp\u4e2d\u3002<\/p>\n
3.\u95f4\u63a5\u8bbf\u95ee\u64cd\u4f5c<\/h3>\n
\u95f4\u63a5\u8bbf\u95ee\u64cd\u4f5c\u662f\u6307\u9488\u64cd\u4f5c\u4e2d\u6700\u5e38\u89c1\u7684\u64cd\u4f5c\uff0c\u5b83\u53ef\u4ee5\u901a\u8fc7\u6307\u9488\u53d8\u91cf\u6765\u8bbf\u95ee\u5b58\u50a8\u5728\u5185\u5b58\u4e2d\u7684\u6570\u636e\u3002\u95f4\u63a5\u8bbf\u95ee\u64cd\u4f5c\u7684\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n
*\u6307\u9488\u53d8\u91cf = \u503c;<\/code><\/pre>\n \u4f8b\u5982\uff1a<\/p>\n
int a = 10; int *p;<\/p>
p = &a;<\/p> *p = 20;<\/code><\/pre>\n
\u4e0a\u9762\u7684\u4ee3\u7801\u5c06\u6574\u578b\u53d8\u91cfa\u7684\u503c\u6539\u4e3a20\u3002<\/p>\n
\u603b\u7ed3<\/h2>\n
\u672c\u6587\u4ecb\u7ecd\u4e86ABPLC\u5229\u7528\u6307\u9488\u5b9e\u73b0\u7684\u7b97\u6cd5\u7684\u57fa\u672c\u539f\u7406\uff0c\u4ee5\u53ca\u5e38\u89c1\u7684\u6307\u9488\u64cd\u4f5c\u65b9\u6cd5\u3002<\/strong>ABPLC\u5229\u7528\u6307\u9488\u5b9e\u73b0\u7684\u7b97\u6cd5\u53ef\u4ee5\u6781\u5927\u5730\u63d0\u9ad8\u8ba1\u7b97\u673a\u7a0b\u5e8f\u7684\u6267\u884c\u6548\u7387\uff0c\u540c\u65f6\u4e5f\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u66f4\u597d\u5730\u63a7\u5236\u7a0b\u5e8f\u7684\u6267\u884c\u6d41\u7a0b\u3002\u6307\u9488\u64cd\u4f5c\u7684\u57fa\u672c\u64cd\u4f5c\u5305\u62ec\u5b9a\u4e49\u6307\u9488\u53d8\u91cf\u3001\u53d6\u5740\u64cd\u4f5c\u548c\u95f4\u63a5\u8bbf\u95ee\u64cd\u4f5c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u6307\u9488\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u53d8\u91cf\uff0c\u5b83\u53ef\u4ee5\u5b58\u50a8\u4e00\u4e2a\u53d8\u91cf\u7684\u5730\u5740\uff0c\u4ece\u800c\u4f7f\u7a0b\u5e8f\u53ef\u4ee5\u76f4\u63a5\u8bbf\u95ee\u53d8\u91cf\u7684\u5185\u5b58\u5730\u5740\u3002ABPLC\u5229\u7528\u6307\u9488\u5b9e\u73b0\u7684\u7b97\u6cd5\u53ef\u4ee5\u6781\u5927\u5730\u63d0\u9ad8\u8ba1\u7b97\u673a\u7a0b\u5e8f\u7684\u6267\u884c\u6548\u7387\uff0c\u540c\u65f6\u4e5f\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005<\/p>\n","protected":false},"author":1,"featured_media":4132,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[36],"tags":[149,395],"class_list":["post-42007","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-plcontroller","tag-algorithm"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/42007","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/comments?post=42007"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/42007\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/4132"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=42007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=42007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=42007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}