I'm a little bit frustrated after I've found this strange atof/stof behavior
double bg = std::stof("1,24");
std::cerr<<"comma: "<<bg<<std::endl;
bg = std::stof("1.24");
std::cerr<<"dot: "<<bg<<std::endl;
when I change the string format, from comma to dot, this is what happens:
comma: 1.24
dot: 1
has anyone encountered this problem? thanks
bart
Aucun commentaire:
Enregistrer un commentaire