Modify a void function to a value-returning

I'm not sure how to change a void function into a value-returning one. The function we were given for class is,
void convertToMeters (int ft, double in, double& m);
To make it return an int:

int convertToMeters (int ft, double in, double& m);

and stick return someInt; in it.
1
2
3
4
5
double convertToMeters (int ft, double in, double& m)
{
//Conversion
return meters;
}

Although you're passing m (meters?) by reference which means that any changes inside the function will affect the variable outside the function.
Topic archived. No new replies allowed.