入力ファイルから double を読み取るために次のように記述しましたが、面倒なようです。他にどのような方法を使用できますか? 知っておくべき長所/短所はありますか?
2進数<->10進数の変換の問題はないはずなので、この方法が最も正確だと思いますが、それは正しいですか?
#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();
}