Ash Ash - 7 months ago 47
C# Question

How can I return multiple values from a function in C#?

I read the C++ version of this question but didn't really understand it.

Can someone please explain clearly if it can be done and how?


Use .NET 4.0+'s Tuple:

For Example:

public Tuple<int, int> GetMultipleValue()
     return Tuple.Create(1,2);