2 added 258 characters in body edited Feb 3 at 3:20 ekkis 32322 silver badges1515 bronze badges I couldn't make that happen either but I did make this work: ``````std::string s("limit: 686.97"); float limit = atoi(s.c_str()); printf("limit [%f]\n", limit); `````` * Edit I * of course, that gets us to integer. sadly the atof is not available, so I think counting the number of digits in the string, removing the dot, converting to an integer and then dividing by the number of digits would give the correct value. bloody mess ``````float _stof(std::string s) { std::size_t i = s.find("."); int digits = s.length() - i - 1; s.erase(i, 1); return atoi(s.c_str()) / pow(10, digits); } `````` I couldn't make that happen either but I did make this work: ``````std::string s("limit: 686.97"); float limit = atoi(s.c_str()); printf("limit [%f]\n", limit); `````` I couldn't make that happen either but I did make this work: ``````std::string s("limit: 686.97"); float limit = atoi(s.c_str()); printf("limit [%f]\n", limit); `````` * Edit I * of course, that gets us to integer. sadly the atof is not available, so I think counting the number of digits in the string, removing the dot, converting to an integer and then dividing by the number of digits would give the correct value. bloody mess ``````float _stof(std::string s) { std::size_t i = s.find("."); int digits = s.length() - i - 1; s.erase(i, 1); return atoi(s.c_str()) / pow(10, digits); } `````` 1 answered Feb 3 at 1:44 ekkis 32322 silver badges1515 bronze badges I couldn't make that happen either but I did make this work: ``````std::string s("limit: 686.97"); float limit = atoi(s.c_str()); printf("limit [%f]\n", limit); ``````