{"id":221676,"date":"2021-07-14T09:01:07","date_gmt":"2021-07-14T01:01:07","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=221676"},"modified":"2021-06-28T11:02:14","modified_gmt":"2021-06-28T03:02:14","slug":"four-linux-china","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/four-linux-china.html","title":{"rendered":"\u7b80\u5355\u4ecb\u7ecdC\u8bed\u8a00\u4f7f\u7528\u56db\u79cd\u65b9\u6cd5\u521d\u59cb\u5316\u7ed3\u6784\u4f53"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u8fd9\u7bc7\u6587\u7ae0\u8bf4\u660e\u4e86\u4ec0\u4e48\u662f\u7ed3\u6784\u4f53,\u4ecb\u7ecd\u4e86\u7ed3\u6784\u4f53\u7684\u6982\u5ff5\u548c\u4f7f\u7528\u4f18\u70b9,\u5728C\u8bed\u8a00\u4e2d\u5982\u4f55\u4f7f\u7528\u548c\u521d\u59cb\u5316\u7ed3\u6784\u4f53\u65b9\u6cd5,\u901a\u8fc7\u8be6\u7ec6\u7684\u4ee3\u7801\u5c55\u5f00\u8fdb\u884c\u8bf4\u660e,\u5e0c\u671b\u8be5\u7bc7\u6587\u7ae0\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\u4ec0\u4e48\u662f\u7ed3\u6784\u4f53<\/strong><\/div>\n

\u5728\u5b9e\u9645\u95ee\u9898\u4e2d\uff0c\u4e00\u7ec4\u6570\u636e\u5f80\u5f80\u6709\u5f88\u591a\u79cd\u4e0d\u540c\u7684\u6570\u636e\u7c7b\u578b\u3002\u4f8b\u5982\uff0c\u767b\u8bb0\u5b66\u751f\u7684\u4fe1\u606f\uff0c\u53ef\u80fd\u9700\u8981\u7528\u5230 char\u578b\u7684\u59d3\u540d\uff0cint\u578b\u6216 char\u578b\u7684\u5b66\u53f7\uff0cint\u578b\u7684\u5e74\u9f84\uff0cchar\u578b\u7684\u6027\u522b\uff0cfloat\u578b\u7684\u6210\u7ee9\u3002\u53c8\u4f8b\u5982\uff0c\u5bf9\u4e8e\u8bb0\u5f55\u4e00\u672c\u4e66\uff0c\u9700\u8981 char\u578b\u7684\u4e66\u540d\uff0cchar\u578b\u7684\u4f5c\u8005\u540d\uff0cfloat\u578b\u7684\u4ef7\u683c\u3002\u5728\u8fd9\u4e9b\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528\u7b80\u5355\u7684\u57fa\u672c\u6570\u636e\u7c7b\u578b\u751a\u81f3\u662f\u6570\u7ec4\u90fd\u662f\u5f88\u56f0\u96be\u7684\u3002\u800c\u7ed3\u6784\u4f53\uff08\u7c7b\u4f3cPascal\u4e2d\u7684\u201c\u8bb0\u5f55\u201d\uff09\uff0c\u5219\u53ef\u4ee5\u6709\u6548\u7684\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002\u7ed3\u6784\u4f53\u672c\u8d28\u4e0a\u8fd8\u662f\u4e00\u79cd\u6570\u636e\u7c7b\u578b\uff0c\u4f46\u5b83\u53ef\u4ee5\u5305\u62ec\u82e5\u5e72\u4e2a\u201c\u6210\u5458\u201d\uff0c\u6bcf\u4e2a\u6210\u5458\u7684\u7c7b\u578b\u53ef\u4ee5\u76f8\u540c\u4e5f\u53ef\u4ee5\u4e0d\u540c\uff0c\u4e5f\u53ef\u4ee5\u662f\u57fa\u672c\u6570\u636e\u7c7b\u578b\u6216\u8005\u53c8\u662f\u4e00\u4e2a\u6784\u9020\u7c7b\u578b\u3002<\/p>\n

\u7ed3\u6784\u4f53\u7684\u4f18\u70b9<\/strong><\/div>\n

\u7ed3\u6784\u4f53\u7684\u4f18\u70b9\uff1a\u7ed3\u6784\u4f53\u4e0d\u4ec5\u53ef\u4ee5\u8bb0\u5f55\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u636e\uff0c\u800c\u4e14\u4f7f\u5f97\u6570\u636e\u7ed3\u6784\u662f\u201c\u9ad8\u5185\u805a\uff0c\u4f4e\u8026\u5408\u201d\u7684\uff0c\u66f4\u5229\u4e8e\u7a0b\u5e8f\u7684\u9605\u8bfb\u7406\u89e3\u548c\u79fb\u690d\uff0c\u800c\u4e14\u7ed3\u6784\u4f53\u7684\u5b58\u50a8\u65b9\u5f0f\u53ef\u4ee5\u63d0\u9ad8CPU\u5bf9\u5185\u5b58\u7684\u8bbf\u95ee\u901f\u5ea6\u3002 <\/p>\n

\u5b9a\u4e49<\/strong><\/div>\n
struct InitMember\r\n{\r\n    int first\uff1b\r\n    double second\uff1b\r\n    char* third\uff1b\r\n    float four;\r\n};<\/pre>\n
\u65b9\u6cd5\u4e00\uff1a\u5b9a\u4e49\u65f6\u8d4b\u503c<\/strong><\/span><\/div>\n
struct InitMember test = {-10,3.141590\uff0c\"method one\"\uff0c0.25}\uff1b<\/pre>\n

\u9700\u8981\u6ce8\u610f\u5bf9\u5e94\u7684\u987a\u5e8f\uff0c\u4e0d\u80fd\u9519\u4f4d\u3002<\/p>\n

\u65b9\u6cd5\u4e8c\uff1a\u5b9a\u4e49\u540e\u9010\u4e2a\u8d4b\u503c<\/strong><\/span><\/div>\n
struct InitMember test\uff1b\r\n\r\ntest.first = -10;\r\ntest.second = 3.141590;\r\ntest.third = \"method two\";\r\ntest.four = 0.25;<\/pre>\n
\u65b9\u6cd5\u4e09\uff1a\u5b9a\u4e49\u65f6\u4e71\u5e8f\u8d4b\u503c\uff08C\u98ce\u683c\uff09<\/strong><\/span><\/div>\n

\u8fd9\u79cd\u65b9\u6cd5\u7c7b\u4f3c\u4e8e\u7b2c\u4e00\u79cd\u65b9\u6cd5\u548c\u7b2c\u4e8c\u79cd\u65b9\u6cd5\u7684\u7ed3\u5408\u4f53\uff0c\u65e2\u80fd\u521d\u59cb\u5316\u65f6\u8d4b\u503c\uff0c\u4e5f\u53ef\u4ee5\u4e0d\u8003\u8651\u987a\u5e8f\uff1b<\/p>\n

struct InitMember test = {\r\n    .second = 3.141590,\r\n    .third = \"method three\",\r\n    .first = -10,\r\n    .four = 0.25\r\n};<\/pre>\n

\u8fd9\u79cd\u65b9\u6cd5\u5728Linux\u5185\u6838\uff08kernel\uff09\u4e2d\u7ecf\u5e38\u4f7f\u7528\uff0c\u5728\u97f3\u89c6\u9891\u7f16\u89e3\u7801\u5e93FFmpeg\u4e2d\u4e5f\u5927\u91cf\u9891\u7e41\u4f7f\u7528\uff0c\u8fd8\u662f\u5f88\u4e0d\u9519\u7684\u4e00\u79cd\u65b9\u5f0f\u3002<\/p>\n

\u65b9\u6cd5\u56db\uff1a\u5b9a\u4e49\u65f6\u4e71\u5e8f\u8d4b\u503c\uff08C++\u98ce\u683c\uff09<\/strong><\/span><\/div>\n

\u8fd9\u79cd\u65b9\u6cd5\u548c\u524d\u4e00\u79cd\u7c7b\u4f3c\uff0c\u7f51\u4e0a\u79f0\u4e4b\u4e3aC++\u98ce\u683c\uff0c\u7c7b\u4f3c\u4e8ekey-value\u952e\u503c\u5bf9\u7684\u65b9\u5f0f\uff0c\u540c\u6837\u4e0d\u8003\u8651\u987a\u5e8f\u3002<\/p>\n

struct InitMember test = {\r\n    second\uff1a3.141590,\r\n    third\uff1a\"method three\",\r\n    first\uff1a-10,\r\n    four\uff1a0.25\r\n};<\/pre>\n

\u5230\u6b64\u8fd9\u7bc7\u5173\u4e8eC\u8bed\u8a00\u4f7f\u7528\u56db\u79cd\u65b9\u6cd5\u521d\u59cb\u5316\u7ed3\u6784\u4f53\u7684\u6587\u7ae0\u5c31\u4ecb\u7ecd\u5230\u8fd9\u4e86<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5728\u5b9e\u9645\u95ee\u9898\u4e2d\uff0c\u4e00\u7ec4\u6570\u636e\u5f80\u5f80\u6709\u5f88\u591a\u79cd\u4e0d\u540c\u7684\u6570\u636e\u7c7b\u578b\u3002\u4f8b\u5982\uff0c\u767b\u8bb0\u5b66\u751f\u7684\u4fe1\u606f\uff0c\u53ef\u80fd\u9700\u8981\u7528\u5230 char\u578b\u7684\u59d3\u540d\uff0cint […]<\/p>\n","protected":false},"author":1482,"featured_media":221292,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-221676","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/221676","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1482"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=221676"}],"version-history":[{"count":1,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/221676\/revisions"}],"predecessor-version":[{"id":221677,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/221676\/revisions\/221677"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/221292"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=221676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=221676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=221676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}