C++中将从文件中读取的字符串转为double类型?
ifstream fin; fin.open("vertex.txt"); char *p1=new char[255]; char *p2=new char[255]; char *p3=new char[255]; while(true) { fin.getline(p1,255,'\n'); fin.getline(p2,255,'\n'); fin.getline(p3,255,'\n'); double xnum=atof(p2); double ynum=atof(p3); }其中获取的p2为:113.177230145951p3为:23.4761739216854用atof函数转换的时候p2的转换时正确的113.17723014595100,p3转换就出问题了,变为23.476173921685401,最后一位变为1??这个是哪里的问题,要怎么改??