Skip to main content
The 2024 Developer Survey results are live! See the results
edited title
Link
huysentruitw
  • 27.9k
  • 10
  • 92
  • 139

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

Source Link
Foo
  • 4.5k
  • 12
  • 40
  • 58

How does C# ref keyword work (in terms of memory)

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?

public void SampleMethod(ref int i) { }