There are some options. Solution 1 is one of them. A similar solution is to return an array with two elements. These two solutions are not very clean, because they are not sound in terms of semantics of the two values returned. In some (more or less rare cases) this is what's needed.
If the values carry distinct semantics, you should better use clearer approach: create a structure or a class with two instance member of required types and return the instance of this type.
Also, let's consider the way beyond return. Alternatively, you can pass a parameter by reference. If you change the parameter value, it will be modified on output. Please see:
http://www.learncpp.com/cpp-tutorial/73-passing-arguments-by-reference[
^].
And a final, side note: many developers do a great code design mistake: returning some status or error code from functions. This approach is badly obsolete and bad. With C++ and most modern languages, you shouldn't return anything like that but should throw an exception.
—SA