{"id":2358,"date":"2023-10-12T00:34:52","date_gmt":"2023-10-11T16:34:52","guid":{"rendered":"https:\/\/white-night.club\/?p=2358"},"modified":"2024-01-29T17:05:22","modified_gmt":"2024-01-29T09:05:22","slug":"pg6","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/10\/12\/pg6\/","title":{"rendered":"C#:\u9690\u5f0f\u7c7b\u578b\u672c\u5730\u53d8\u91cf"},"content":{"rendered":"\n<p>\u5927\u81f4\u8bb0\u5f55\u4e0bvar\u5728C#\u4e2d\u7684\u7528\u6cd5\u3002<\/p>\n\n\n\n<div style=\"height:60px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<blockquote class=\"wp-block-quote has-luminous-vivid-amber-color has-text-color\">\n<p>\u4ec0\u4e48\u65f6\u5019\u7528var<\/p>\n<cite><em>\u53d8\u91cf\u7531\u7f16\u8bd1\u5668\u5206\u914d\u7c7b\u578b<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u7b80\u5355\u6765\u8bf4\uff0c\u5f53\u4f60\u4e0d\u786e\u5b9a\u5c06\u6765\u67d0\u4e2a\u53d8\u91cf\u53ef\u80fd\u662f\u4ec0\u4e48\u7c7b\u578b\u7684\u65f6\u5019\u5c31\u7528var\u3002\u6bd4\u5982\u63a5\u53d7\u67d0\u4e2a\u7269\u54c1\u7684id\u65f6\uff0c\u8fd9\u4e2aid\u53ef\u80fd\u662f\u4ece1\u4e00\u76f4\u523099999\u7684int\u578b\uff0c\u4e5f\u53ef\u80fd\u662f\u8d85\u957f\u7684\u5b57\u7b26\u4e32\u3002\u4f46\u662f\u4f60\u76ee\u524d\u8fd8\u6ca1\u60f3\u597did\u5230\u5e95\u8be5\u7528\u54ea\u4e00\u79cd\u65b9\u5f0f\uff0c\u8fd9\u65f6\u4f60\u5c31\u53ef\u4ee5\u7528var\u53bb\u58f0\u660e\u53d8\u91cf\uff0c\u7b49\u5230\u8be5\u53d8\u91cf\u521d\u59cb\u5316\u7684\u65f6\u5019\uff0c\u7f16\u8bd1\u5668\u5c31\u4f1a\u81ea\u52a8\u628a\u5b83\u8f6c\u4e3a\u5408\u9002\u7684\u7c7b\u578b\u3002<\/p>\n\n\n\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c<mark style=\"background-color:rgba(0, 0, 0, 0);color:#fcb900\" class=\"has-inline-color\">var\u58f0\u660e\u7684\u9690\u5f0f\u53d8\u91cf\u5728\u521d\u59cb\u5316\u540e\u5c31\u4e0d\u80fd\u53d8\u66f4\u4e3a\u5176\u4ed6\u7c7b\u578b\u7684\u53d8\u91cf\u4e86<\/mark>\u3002\u6bd4\u5982\u4e0b\u9762\u8fd9\u4e2a\u9519\u8bef\u4f8b\u5b50\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>var tmp=10;\r\ntmp=\"Hello\";\r\nConsole.WriteLine(tmp);\r\n<mark style=\"background-color:rgba(0, 0, 0, 0);color:#00ff2f\" class=\"has-inline-color\">\/*\u62a5\u9519\uff1a\r\n*(2,11): error CS0029: Cannot implicitly convert type 'int' to 'string'\r\n*\/<\/mark><\/code><\/pre>\n\n\n\n<p>\u800c\u4e14\u5fc5\u987b\u5728\u5b9a\u4e49var\u7684\u540c\u65f6\u5bf9\u5176\u8fdb\u884c\u521d\u59cb\u5316\uff0c\u56e0\u4e3a\u7f16\u8bd1\u5668\u8981\u5728\u5b9a\u4e49\u53d8\u91cf\u7684\u65f6\u5019\u5c31\u4e3a\u5176\u5206\u914d\u5bf9\u5e94\u7684\u7c7b\u578b\u3002\u4e0b\u9762\u8fd9\u4e2a\u4ee3\u7801\u4e5f\u662f\u9519\u8bef\u793a\u8303<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>var tmp;\r\ntmp=\"Hello\";\r<\/code><\/pre>\n\n\n\n<p>\u5f53\u7136\u7ecf\u5e38\u7528var\u4e5f\u4e0d\u592a\u597d\uff0c\u8981\u662f\u6574\u6bb5\u4ee3\u7801\u770b\u4e0b\u6765\u90fd\u662fvar\uff0c\u90a3\u627ebug\u7684\u65f6\u5019\u8fd8\u5f97\u53bb\u60f3\u4e0b\u8fd9\u4e2a\u53d8\u91cf\u5230\u5e95\u662f\u5565\u7c7b\u578b\uff0c\u8fd8\u662f\u633a\u6298\u78e8\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>var\u7684\u7528\u6cd5<\/p>\n","protected":false},"author":1,"featured_media":3838,"comment_status":"open","ping_status":"","sticky":false,"template":"base","format":"standard","meta":{"footnotes":""},"categories":[97,33],"tags":[137],"_links":{"self":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/2358"}],"collection":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/comments?post=2358"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/2358\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media\/3838"}],"wp:attachment":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media?parent=2358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=2358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=2358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}