【发布时间】:2013-07-25 00:09:40
【问题描述】:
我想从文本文件中读取双精度 例如 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);
【问题讨论】:
-
请阅读手册了解
printf的作用。