How to read float with scientific notation from file C++?
I have a file with this format: -0.0064785667 0.73900002 0.028505694 4.7858757e-39 315 218 -0.0051828534 0.73900002 0.028505694 4.6936954e-39 316 218 -0.0038818798 0.73799998 0.028467119 5.1546736e-39 317 218 -0.0025879198 0.73799998 0.028467119 5.6160217e-39 318 218 -0.0012939599 0.73799998 0.028467119 6.4461411e-39 319 218 I read it with this code: using namespace std; ifstream inputFile; //Opens data file for reading. inputFile.open(filePath.c_str()); //Creates vector, initially with 0 points. vector<Point> data(0); float temp_x,temp_y,temp_z,rgb=0,discard_1=0,discard_2=0; //Read contents