How to convert string to float?

前端 未结 8 1340
执念已碎
执念已碎 2020-11-27 03:21
#include
#include

int main() 
{
    char s[100] =\"4.0800\" ; 

    printf(\"float value : %4.8f\\n\" ,(float) atoll(s)); 
    return         


        
8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 04:09

    Main()  {
        float rmvivek,arni,csc;
        char *c="1234.00";
        csc=atof(c);
        csc+=55;
        printf("the value is %f",csc);
    }
    

提交回复
热议问题