I've tried numerous ways to try to pass a double to a function and gets its value back with no success:
My main function declares the following variables and prototype for the function pkaden:
I want the function to return a 1 if no errors along with the an errorMsg or a PKA value. Here's the call in my main function. I'm using a Coldfusion API, so that's what the p-request is about:
in my pkaden function, I set PKA = 1000 for testing purposes. However, after I check it following the function call in my main page, it doesn't change value and is still set to -99.0
Can anyone help me? Not sure what I'm doing wrong.
My main function declares the following variables and prototype for the function pkaden:
Code:
char ErrorMsg[150];
char s[MAX_SMI];
double PKA;
int pkaden(char *,char *,double);
char CF_PKA[150];
Code:
CF_PKA[0] = '\0';
if (pkaden(s,ErrorMsg,PKA)) {
sprintf(CF_PKA,"%f",PKA);
}
else {
strcpy(CF_PKA,ErrorMsg);
}
pRequest->SetVariable("CF_PKA",CF_PKA);
in my pkaden function, I set PKA = 1000 for testing purposes. However, after I check it following the function call in my main page, it doesn't change value and is still set to -99.0
Can anyone help me? Not sure what I'm doing wrong.