C# ref keyword usage

后端 未结 7 1377
耶瑟儿~
耶瑟儿~ 2020-12-10 03:39

I understand (or at least I believe I do) what it means to pass an instance of a class to a method by ref versus not passing by ref. When or under

7条回答
  •  孤街浪徒
    2020-12-10 04:32

    When you may replace the original object, you should send him as ref. If it's just for output and can be uninitialized before calling the function, you'll use out.

提交回复
热议问题