 <p>If you want to return two values, return a <code>std::vector</code> with them. Maybe a <code>std::pair</code>, or a class. As far as why, this is just how C++ works. Comma is just an operator, like + or -. It discards its left operand and returns the right one. <code>return</code> returns the value of its expression from the function. The rest you can figure out yourself.</p>