Hello, I want to pass the name of double variables as arguments to a function. I tried to do it by passing them as string arrays. They passed OK, but the function did not act upon the original double variables as I had intended.
Can someone please help ? - Can this be done in C ?
Thanks kindly.
example of passing the name of a double to the function in the form of a string array:
Code:
validChecker("sampleDoubleNameInStringFormat");
This is the function. How do I get scanf to recognise the string argument as a real double variable ? At the moment it is not.
Code:
int validChecker(char argumentRepresentingADoubleVariable[]) {
scanf("%lf", &argumentRepresentingADoubleVariable);
return 0;
}