strtol:字符串按进制转整数并提取非数字字符。 strtod:字符串按进制转浮点数并提取非数字字符。 atoi:字符串转整数。 atof:字符串转浮点数。 我自己实现的逻辑 sscanf(char*ch,"%lf",double&res);//这是c库函数。