2 added 258 characters in body
source | link

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
source | link

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);