📜  将 char 数组转换为 double - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:44.079000             🧑  作者: Mango

代码示例1
double toDouble(const char* s, int start, int stop) {
    unsigned long long int m = 1;
    double ret = 0;
    for (int i = stop; i >= start; i--) {
        ret += (s[i] - '0') * m;
        m *= 10;
    }
    return ret;
}