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?
You cannot do this in C#. What you can do is have a out
parameter or return your own class (or struct if you want it to be immutable).
public int GetDay(DateTime date, out string name)
{
// ...
}
Using custom class (or struct)
public DayOfWeek GetDay(DateTime date)
{
// ...
}
public class DayOfWeek
{
public int Day { get; set; }
public string Name { get; set; }
}