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.93164 but not 39.9316476397222 anyone knows why? Thanks!
int NodeID;
double _lat,_long;
fscanf (pFile, "%d %lf %lf", &NodeID,&_lat,&_long);
printf ("I have read: %d %f %fn", NodeID,_lat,_long);
fscanf (pFile, "%d %lf %lf", &NodeID,&_lat,&_long);
printf ("I have read: %d %lf %lfn", NodeID,_lat,_long);
Aucun commentaire:
Enregistrer un commentaire