an action such as reading the value of a sensor has the chance of failure. To make it more explicit whether the sensor was successfully read, many times the return value of the function is a boolean indicating success or failure. The value being read is then passed by reference instead.
example:
bool read(&value);
or there could be a private variable such as value_
https://github.com/vanderbiltrobotics/loadcell/blob/a466c2e6b498ede84c17b5829522f91719adbeb6/HX711.h#L48
related to #1 #2
an action such as reading the value of a sensor has the chance of failure. To make it more explicit whether the sensor was successfully read, many times the return value of the function is a boolean indicating success or failure. The value being read is then passed by reference instead.
example:
or there could be a private variable such as
value_