This is for a mathematical method that takes in 3 doubles as input (a, b,c ).
Next those 3 values get calculated in a formula (abc formula for square roots).
The formula has 2 values that have to be returned but how exactly do i do this?
I was thinking of a array / objects, but not sure how to initialise them for this purpose. Out parameters are not really of any use in this situation are they?
Regards.
In C# 4 (available in Visual Studio 2010):
If you’re working with an earlier language version of C#, you can define your own implementation of a two-tuple (pair) as follows:
Of course,
Tupleis a very general and unspecific data type. You could just as well implement a composite return type (similar to what I just showed, but simpler) that is more specific to your situation.