c#面试中的ref参数问题 [英] ref parameters in c# interview Question

查看:80
本文介绍了c#面试中的ref参数问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以在C#中存储ref参数中的值类型

we can store value types in ref parameter in C#

推荐答案

ref参数可用于值和引用类型。

ref parameter can be used for both value and reference types.
Quote:

无论是值类型还是引用类型,都可以通过ref修改方法参数。

A method parameter can be modified by ref regardless of whether it is a value type or a reference type.


是的,您可以使用ref参数传递参考或值类型。



请参阅下面的更多信息。



http://msdn.microsoft .com / zh-CN / library / 14akc2c7.aspx [ ^ ]
Yes , you can use ref parameters to pass reference or value types.

Please refer below more info.

http://msdn.microsoft.com/en-us/library/14akc2c7.aspx[^]


这篇关于c#面试中的ref参数问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆