Answers for "how to extarct float from string in c"

C
5

convert string to float c

char myString = "6.88";
float x = atof(myString);
//x is now 6.88
Posted by: Guest on February-20-2020
0

c convert float to string

#include <stdio.h>
int main()
{
   float f = 1000;
   char c[50]; //size of the number
    sprintf(c, "%g", f);
    printf(c);
    printf("n");
}
Posted by: Guest on March-18-2021

Code answers related to "C"

Browse Popular Code Answers by Language