我想从文本文件中读取双精度,例如 31 39.9316476397222 116.113516352222
我都试过了,都不行。我只能读取前几个十进制数字,例如 39.93164 而不是 39.9316476397222 有人知道为什么吗?谢谢!
int NodeID;
double _lat,_long;
fscanf (pFile, "%d %lf %lf", &NodeID,&_lat,&_long);
printf ("I have read: %d %f %f\n", NodeID,_lat,_long);
fscanf (pFile, "%d %lf %lf", &NodeID,&_lat,&_long);
printf ("I have read: %d %lf %lf\n", NodeID,_lat,_long);