So I am working on this project where I have to read in a CSV file which contains numbers that are represented in scientific notation. So far what I have is to read in each number then convert that number into string then convert it to double with stringstream but I am not sure if this is the correct way to do it. Any advice / suggestion would be helpful!
double temp;
istringstream in(line); //line is the string which contains the number, ex: 3.30144800e+03
in >> temp;
arr[w++] = temp;
You can convert a string to a double with
std::atofOR you can simply stream the double out of the buffer…