Below is the answer:
I wanted to write the extracted values to file in vugen, Loadrunner.
There may be multiple values extracted and count of extracted values may differ on each iteration.
Below is the working condition:
count = atoi(lr_eval_string("{correlation_param_count}")); // to save the values count in parameter
hf = fopen("D:\\value.txt", "w");
for(i=1; i<=count;i++)
{
sprintf(value,"{correlation_param_%d}",i);
fprintf(hf, "correlation_value=%s,\n", lr_eval_string(value)); //to write all values in new line
}
fclose( hf);
It is working as expected