Skip to content

Instantly share code, notes, and snippets.

@ufcpp
Created February 10, 2015 15:44
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 ufcpp/a375dff05c33cb837770 to your computer and use it in GitHub Desktop.
Save ufcpp/a375dff05c33cb837770 to your computer and use it in GitHub Desktop.
multiple return values by out parameters
public void Tally(IEnumerable<int> values, out int sum, out int count) { ... }
int s, c;
Tally(myValues, out s, out c);
Console.WriteLine($"Sum: {s}, count: {c}");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment