Defibrillator puzzle and setlocale bug

Hi all,

So I managed to solve the Defibrillator puzzle, with C++. But something bothered me: the input files contained commas instead of dots to store floating numbers. To fix this, I just created new strings that store the numbers with dots instead, in order to be accurately parsed by atof.

But afterward, I discovered that I could use setlocale to specify that atof has to use the FR locale instead. I tried it on my computer and everything worked, so I figured I could update my code accordingly to remove these uggly string manipulations. Well, it didn’t work, and someone told me on the IRC channel that “locale doesn’t work because it seems the relevant files are just missing from the test servers”.

What do you think?

1 Like