Ash Ash - 1 year ago 100
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?

Answer Source

Use .NET 4.0+'s Tuple:

For Example:

public Tuple<int, int> GetMultipleValue()
     return Tuple.Create(1,2);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download