I want to read double from text file e.g. 31 39.9316476397222 116.113516352222
I tried both, not work. I can only read the first few decimal digital e.g. 39.9316
According to the fscanf man page, you should use %lf for double :
f, e, g (Floating point number) : A series of decimal digits, optionally containing a decimal point, optionally preceeded by a sign (+ or -) and optionally followed by the e or E character and a decimal integer (or some of the other sequences supported by strtod). Implementations complying with C99 also support hexadecimal floating-point format when preceded by 0x or 0X.