Jul 3, 2012 at 6:18pm
If you want to return by reference, you need to change your function header to show that.
int& foo(int* ptr);
There's an example that takes a pointer to an int as a parameter, and returns a reference to an int as a return value.
Jul 3, 2012 at 6:18pm
In convert you are passing in a pointer and returning a value. If you want to work with a reference then perhaps:
1 2 3 4
|
void convert(double &measurement)
{
measurement *= 2.54;
}
|
then you would just pass by convert(measurement) instead of passing a pointer
Last edited on Jul 3, 2012 at 6:19pm
Jul 3, 2012 at 6:22pm
ok. those are both helpful. thank you ResidentBiscuit and Texan40. let me see what I can do.