#include <cstdlib> in the code listing for strtod.