Quantcast
Channel: LoadRunner Practitioners Forum topics
Viewing all articles
Browse latest Browse all 3978

Floating point numbers multiplication in LoadRunner

$
0
0

Hi,

I have written this code to multiply 2 floating point numbers and then saving it into a parameter:

Action()
{

double i;
double q;
double result,output;
double finalOutput;
int decimals=0;
i=atof(lr_eval_string("{UnitPrice}"));
q=atof(lr_eval_string("{Quantity}"));

result=i*q;

sprintf(result,"%2f",decimals);
sprintf(finalOutput,"Value=%2f",result);

//lr_get_attrib_double(result);
lr_output_message("%s",lr_eval_string("{OutPut}"));
    
    return 0;
}

I'm getting this error message: Action.c(14): Error: C interpreter run time error: Action.c (14):  Error -- memory violation : Exception ACCESS_VIOLATION received.

Line 14: sprintf(result,"%2f",decimals);

 

Any inputs/suggestions are highly welcome.

Thanks in advance,

sroy1

 


Viewing all articles
Browse latest Browse all 3978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>