如果需要查看更多文章,请微信搜索公众号 csharp编程大全,需要进C#交流群群请加微信z438679770,备注进群, 我邀请你进群! ! !
ref:
C#有两种参数传递方式:传值和引用,传值就是变量的值,而引用则是传递的变量的地址;
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication8 { class Program { static void Main(string[] args) { int a = 10; sumd(ref a); Console.WriteLine(a); Console.ReadKey(); } static void sumd(ref int b) { b = b* b; } } }
运行结果: 你猜猜是什么? 10么
最新评论
我这边UI界面用React重写了,地址是 https://vps.kkwen.cn,有需要可以提供给你
Thankfulness to my father who told me concerning this webpage, this web site is genuinely remarkable