【C语言】串为“123.23”,转换成数值123.23。

日期:2021-10-25 05:42:10 人气:1

【C语言】串为“123.23”,转换成数值123.23。

#include<stdio.h>
float mystof(char *s)
{
int i;
float t1=0,t2=0,k=0.1;
for(i=0;s[i]!='\0'&&s[i]!='.';i++)
{
t1=t1*10+s[i]-'0';
    A+
热门评论