{"id":137836,"date":"2020-07-20T00:56:40","date_gmt":"2020-07-19T16:56:40","guid":{"rendered":"http:\/\/4563.org\/?p=137836"},"modified":"2020-07-20T00:56:40","modified_gmt":"2020-07-19T16:56:40","slug":"%e5%9c%a8-c-%e4%b8%ad%e8%87%aa%e5%b7%b1%e5%ae%9e%e7%8e%b0%e4%ba%86%e4%b8%80%e4%b8%aa%e6%a0%88%e6%95%b0%e6%8d%ae%e7%bb%93%e6%9e%84%ef%bc%8c%e6%a0%88%e5%85%83%e7%b4%a0%e7%b1%bb%e5%9e%8b%e8%ae%be","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=137836","title":{"rendered":"\u5728 C \u4e2d\u81ea\u5df1\u5b9e\u73b0\u4e86\u4e00\u4e2a\u6808\u6570\u636e\u7ed3\u6784\uff0c\u6808\u5143\u7d20\u7c7b\u578b\u8bbe\u7f6e\u4e3a SElemType\uff0c\u4f7f\u7528\u7684\u65f6\u5019\u7528 typedef \u5b9a\u4e49\uff0c\u6bd4\u5982 typedef int SElemType\u3002\u73b0\u5728\u8981\u5728\u4e00\u4e2a\u7a0b\u5e8f\u4e2d\u7528\u4e24\u4e2a\u6808\uff0c\u5206\u522b\u4fdd\u5b58 int \u548c float\uff0c\u8bf7\u95ee\u8be5\u600e\u4e48\u529e\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5728 C \u4e2d\u81ea\u5df1\u5b9e\u73b0\u4e86\u4e00\u4e2a\u6808\u6570\u636e\u7ed3\u6784\uff0c\u6808\u5143\u7d20\u7c7b\u578b\u8bbe\u7f6e\u4e3a SElemType\uff0c\u4f7f\u7528\u7684\u65f6\u5019\u7528 typedef \u5b9a\u4e49\uff0c\u6bd4\u5982 typedef int SElemType\u3002\u73b0\u5728\u8981\u5728\u4e00\u4e2a\u7a0b\u5e8f\u4e2d\u7528\u4e24\u4e2a\u6808\uff0c\u5206\u522b\u4fdd\u5b58 int \u548c float\uff0c\u8bf7\u95ee\u8be5\u600e\u4e48\u529e\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nerif <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\">                        \u7528\u5b8f\u6765\u751f\u6210\u5bf9\u5e94\u7684 struct \u548c typedef \uff1f<br \/>\u6bd4\u5982\u539f\u6765\u662f\u8fd9\u6837\u7684<br \/>&#8220;`<br \/>typedef int SElemType;<br \/>struct my_struct<br \/>{<br \/>SElemType x;<br \/>};<br \/>&#8220;`<br \/>\u73b0\u5728\u53ef\u4ee5\u6539\u6210<br \/>&#8220;`<br \/>#define DEF_MY_STRUCT(T) <br \/>typedef T SElemType_##T; <br \/>struct my_struct_##T <br \/>{ <br \/>SElemType_##T x; <br \/>};<\/p>\n<p>DEF_MY_STRUCT(int);<br \/>&#8220;`      <\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>3<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"2603204\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ysc3839 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ysc3839 \u8c22\u8c22\u8001\u54e5\uff0c\u8fd9\u79cd\u65b9\u6cd5\u786e\u5b9e\u80fd\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u89e3\u51b3\u95ee\u9898\uff0c\u4f46\u8fd8\u6709\u4e00\u4e9b\u95ee\u9898\u65e0\u6cd5\u89e3\u51b3\u3002\u6211\u5b9a\u4e49\u4e86\u6808\u7684\u4e00\u4e9b\u64cd\u4f5c\u51fd\u6570\uff0c\u90e8\u5206\u51fd\u6570\u7684\u53c2\u6570\u7c7b\u578b\u4e3a SElemType\uff0c\u6bd4\u5982 Push(Stack *S, SElemType e)\u3002\u5982\u679c\u7528\u5b8f\u7684\u65b9\u6cd5\uff0c\u90a3\u542b\u6709 SElemType \u7c7b\u578b\u53c2\u6570\u7684\u64cd\u4f5c\u51fd\u6570\u8be5\u5982\u4f55\u5b9e\u73b0\uff0c\u4e5f\u50cf struct \u4e00\u6837\u5728\u5b8f\u91cc\u5b9e\u73b0\u5417\uff0c\u90a3\u6837\u5b8f\u5c31\u6709\u70b9\u592a\u957f\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2603205\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : nerif <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @nerif \u662f\u7684\uff0c\u5426\u5219\u4f60\u5f97\u5b9e\u73b0\u4e00\u4e2a variant \u7c7b\u578b\u3002\u56e0\u4e3a\u4e0d\u540c\u6570\u636e\u7c7b\u578b\u7f16\u8bd1\u51fa\u6765\u7684\u4ee3\u7801\u662f\u4e0d\u540c\u7684\uff0c\u4f60\u8981\u540c\u6837\u7684\u4ee3\u7801\u652f\u6301\u4e0d\u540c\u6570\u636e\u7c7b\u578b\u7684\u8bdd\uff0c\u53ea\u80fd\u628a\u8fd9\u4e9b\u6570\u636e\u7c7b\u578b\u90fd\u585e\u5230\u4e00\u4e2a\u6570\u636e\u7ed3\u6784\u4e2d\u3002<br \/>\u53e6\u5916\uff0c\u5982\u679c\u6761\u4ef6\u5141\u8bb8\u7684\u8bdd\uff0c\u66f4\u5efa\u8bae\u76f4\u63a5\u4f7f\u7528 C++\u3002\u5fc5\u987b\u7528 C \u7684\u8bdd\u4e5f\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2603206\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ysc3839 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ysc3839 \u597d\u7684\uff0c\u8c22\u8c22\u8001\u54e5\uff0c\u770b\u6765\u6211\u786e\u5b9e\u5f97\u8003\u8651\u7528 C++ \u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 C \u4e2d\u81ea\u5df1\u5b9e\u73b0\u4e86\u4e00\u4e2a\u6808\u6570\u636e\u7ed3\u6784&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/137836"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=137836"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/137836\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=137836"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=137836"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=137836"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}