{"id":2858,"date":"2020-11-11T10:16:52","date_gmt":"2020-11-11T02:16:52","guid":{"rendered":"http:\/\/blog.coolcoding.cn\/?p=2858"},"modified":"2020-11-11T10:16:52","modified_gmt":"2020-11-11T02:16:52","slug":"c%e5%87%bd%e6%95%b0%e8%bf%94%e5%9b%9e%e5%a4%9a%e4%b8%aa%e5%80%bc","status":"publish","type":"post","link":"https:\/\/blog.coolcoding.cn\/?p=2858","title":{"rendered":"C#\u51fd\u6570\u8fd4\u56de\u591a\u4e2a\u503c"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>\u65b9\u6cd5\u4e00\uff1a\u4f7f\u7528\u7ed3\u6784\u4f53\u5305\u4e00\u4e0b\nstruct MultiObj\n{\n  int a;\n  int b;\n  string c;\n}\n\nMultiObj getVal();\n\n\n\u65b9\u6cd5\u4e8c\uff1a\u4f7f\u7528out\u5173\u952e\u5b57\u9010\u4e2a\u4f20\u51fa\nvoid getVal(out int a, out int b, out string c);\n\n\n\u65b9\u6cd5\u4e09\uff1a\u4f7f\u7528\u5143\u7ec4Tuple\uff08C#4.0\u4ee5\u4e0a\uff09\nTuple&lt;int, int, string> getVal()\n{\n    return Tuple.Create(100, 100, \"what\");\n    return new Tuple&lt;int, int, string>(100, 100, \"what\");\n}\n\nvar k = getVal();\nvar c = k.Item1 + k.Item2;\n\n\n\u65b9\u6cd5\u56db\uff1a\u4f7f\u7528\u5143\u7ec4\u8bed\u6cd5\u7cd6\uff08C#7.0\u4ee5\u4e0a\uff09\n(int, int, string) getVal()\n{\n  return (100, 100, \"what\");\n}\n\nvar k = getVal();\nvar c = k.Item1 + k.Item2;\n\n-----------------------------------------------------\n\n(int, int, string) obj1 = (100, 100, \"what1\");\n(int, int, string) obj2 = (100, 100, \"what2\");\nif (obj1 == obj2) ...\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/2858"}],"collection":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2858"}],"version-history":[{"count":1,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/2858\/revisions"}],"predecessor-version":[{"id":2859,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/2858\/revisions\/2859"}],"wp:attachment":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2858"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2858"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}