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?
Ways to do it:
1) KeyValuePair (Best Performance - 0.32 ns):
KeyValuePair Location(int p_1, int p_2, int p_3, int p_4)
{
return new KeyValuePair(p_2 - p_1, p_4-p_3);
}
2) Tuple - 5.40 ns:
Tuple Location(int p_1, int p_2, int p_3, int p_4)
{
return new Tuple(p_2 - p_1, p_4-p_3);
}
3) out (1.64 ns) or ref 4) Create your own custom class/struct
ns -> nanoseconds
Reference: multiple-return-values.