問題:
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]