问题:
This question already has an answer here: 这个问题已经在这里有了答案:
What is the difference between ref
and out
parameters in .NET? .NET中的ref
和out
参数之间有什么区别? What are the situations where one can be more useful than the other? 在什么情况下一个可以比另一个更有用? What would be a code snippet where one can be used and another can't? 一个可以使用而另一个不能使用的代码片段是什么?
解决方案:
参考一: https://stackoom.com/question/ZBC参考二: Difference between ref and out parameters in .NET [duplicate]