Hello, I created the following code to pass the the variable 'inputVoltage' by reference to the function 'input'. It certainly seems to work when I run the program, but have I actually done it correctly ?
Thanks for any confirmation.
int main ( {
double inputVoltage;
input(&inputVoltage);
return 0;
}
int input(double* inputVoltage)
{
cin >> *inputVoltage;
etc.
etc.
}
yes, I did declare the function like this: 'int input(double *inputVoltage);'
My version worked. i understand it is not conventional, so how come it still worked ?
What was I actually doing with my implementation ?