您的位置:首页 > 编程语言 > C语言/C++

引用类型:ref,out

2017-01-20 16:57 162 查看




带ref的代码

static void Main(string[] args)
{

int c = 20;
int d = add(ref c);
Console.WriteLine(c);
Console.ReadKey();
}
public static int add(ref int a)
{
return a = a + 100;
}


带ref的结果



不带Ref的结果

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c语言 ref out