I am using libconfig for an input file on my C program. The float/double values are read as expected, however when writting them to a stream, the doubles are rounded to integers. I read that you can modify the precision using config_set_float_precision, but as the default is 6, I do not believe this is the problem.
FILE* fh = fopen(strcat(output_file_tmp,"/input__.cfg"),"w");
if(!fh){perror("output copy of input.cfg could not be open");}
config_setting_t *root = config_root_setting(cfg);
config_write(cfg,fh);
fclose(fh);
Thanks for your help and for the amazing library.
I am using libconfig for an input file on my C program. The float/double values are read as expected, however when writting them to a stream, the doubles are rounded to integers. I read that you can modify the precision using config_set_float_precision, but as the default is 6, I do not believe this is the problem.
FILE* fh = fopen(strcat(output_file_tmp,"/input__.cfg"),"w");
if(!fh){perror("output copy of input.cfg could not be open");}
config_setting_t *root = config_root_setting(cfg);
config_write(cfg,fh);
fclose(fh);
Thanks for your help and for the amazing library.