Skip to content

Instantly share code, notes, and snippets.

@Ibro
Created December 30, 2017 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ibro/08a009c7f62f7210411203425708be1e to your computer and use it in GitHub Desktop.
Save Ibro/08a009c7f62f7210411203425708be1e to your computer and use it in GitHub Desktop.
public class RefLocals
{
private int _age = 15;
public void ReferenceToField()
{
ref int someReferenceToAge = ref _age;
someReferenceToAge = 45;
}
public void PrintAge()
{
Console.WriteLine($"Age: {_age}");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment