I think you're confused because the function appears to be returning two different things. You can do this in C++ by returning one thing in the return value and another thing in a reference parameter:
1 2 3
// Given the numerator and denominator of a fraction, return true if the fraction
// is greater than 1. Otherwise subtract one and return the value in "res"
bool func(unsigned numerator, unsigned denominator, double &res)