How does the ref keyword work (in terms of memory)

后端 未结 4 2012
广开言路
广开言路 2021-02-12 13:48

C# has a ref keyword. Using ref you can pass an int to a method by reference. What goes on the stack frame when you call a method that accepts an int by reference?



        
4条回答
  •  情深已故
    2021-02-12 14:12

    It will pass the local variable by reference instead of sending a new copy for it

提交回复
热议问题