Skip to content

Instantly share code, notes, and snippets.

@daneb
Last active July 19, 2019 09:40
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 daneb/13124e5ec2369117aff8fc27a3a861e5 to your computer and use it in GitHub Desktop.
Save daneb/13124e5ec2369117aff8fc27a3a861e5 to your computer and use it in GitHub Desktop.
Generics
public void SwapInt(ref int lhs,ref int rhs)
{
int temp;
temp = lhs;
lhs = rhs;
rhs = temp;
}
public void SwapString(ref string lhs, ref string rhs)
{
string temp;
temp = lhs;
lhs = rhs;
rhs = temp;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment