{"author_url":"https://blog.hatena.ne.jp/Csh/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcsh-2.hatenadiary.org%2Fentry%2F20100310%2F1268169487\" title=\"\u5b9f\u7fd2\u3000ref\u30ad\u30fc\u30ef\u30fc\u30c9 - C#\u306b\u30cf\u30de\u3063\u3066\u307f\u308b\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","type":"rich","image_url":null,"provider_name":"Hatena Blog","title":"\u5b9f\u7fd2\u3000ref\u30ad\u30fc\u30ef\u30fc\u30c9","author_name":"Csh","categories":[],"height":"190","blog_url":"https://csh-2.hatenadiary.org/","description":"using System; class CallByReferenceTest { static void Main() { int n = 5; Console.WriteLine(\"n: {0}\", n); Square(ref n); // \u5f15\u6570\u6e21\u3059\u6642\u3082ref\u3064\u3051\u306a\u3044\u3068\u30a8\u30e9\u30fc\u3002 Console.WriteLine(\"n: {0}\", n); } // ref\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u5f15\u6570\u306b\u3064\u3051\u308b\u3068\u53c2\u7167\u6e21\u3057\u306b\u306a\u308b\u3002 // \u623b\u308a\u5024\u304cvoid\u306a\u306e\u306b\u3001x\u304c\u66f8\u304d\u63db\u308f\u308b\u3053\u3068\u306b\u6ce8\u610f\u3002 static void Square(ref int n) { n = n * n; } } \u2193 n: 5 n: 25 ref\u306b\u3088\u3063\u2026","version":"1.0","provider_url":"https://hatena.blog","url":"https://csh-2.hatenadiary.org/entry/20100310/1268169487","published":"2010-03-10 06:18:07","blog_title":"C#\u306b\u30cf\u30de\u3063\u3066\u307f\u308b\u65e5\u8a18","width":"100%"}