码迷,mamicode.com
首页 > Windows程序 > 详细

C# Out 传值

时间:2016-08-04 13:24:40      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:

public void Out(out int a, out int b)
{//out相当于return返回值
//可以返回多个值
//拿过来变量名的时候,里面默认为空值
a=1;
b=2;
}


static void Main(string[] args)
{
int a = 0;
int b = 1;
Program hanshu = new Program();
hanshu.Out(out a, out b);

C# Out 传值

标签:

原文地址:http://www.cnblogs.com/1711643472qq/p/5736012.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!