I have a problem. I am using this code to print from text file but the program gives me a different number -such as 11732408.000000
- each time. However I don't get this problem when ex
is integer.
#include <stdio.h>
#include <string.h>
int main() {
char example[] ="123.12/456 ";
double ex = atof(strtok(example, "/"));
printf("%lf", ex);
return 0;
}