How do you return two values from a single method?

后端 未结 22 782
谎友^
谎友^ 2020-12-11 00:58

When your in a situation where you need to return two things in a single method, what is the best approach?

I understand the philosophy that a method should do one t

22条回答
  •  既然无缘
    2020-12-11 01:52

    In the C/C++ world it would actually be quite common to pass two variables by reference (an example, your no. 2).

提交回复
热议问题