I've written the following to read doubles from an input file, but it seems cumbersome, what other method(s) could I use? Are there pros/cons that I should be aware of?
I would think that this method would be the most accurate since there shouldn't be any binary<->decimal conversion issues, is that correct?
#include<string>
#include<iostream>
#include<iomanip>
#include<fstream>
#include<sstream>
void Stats::fill()
{
string temp;
stringstream convert;
statFile.open("statsinput.txt");
for(int i = 0; i<maxEntries && !statFile.eof(); i++)
{
getline(statFile, temp);
convert<<temp;
convert>>stats[i];
}
statFile.close();
}