If I have a function that produces a result int and a result string, how do I return them both from a function?
As far as I can tell I can
Two different approaches:
I think that #1 is a little more obvious about what's going on, although it can get tedious if you have too many return values. In that case, option #2 works fairly well, although there's some mental overhead involved in making specialized structs for this purpose.