[ad_1]
Make the parameter length a reference. void getLength (double & length) and delete the return. After calling the function the passed parameter has the value assigned to it in the function.
2
[ad_2]
solved How to return values from a void function?