test.csv
all the datas under the column "ets" are intergers. However, if I choose to open the file using ifstream (the code is listed as below), the program will complain that the data field is not a number.
#include <csv.hpp>
#include
#include
using namespace std;
using csv::CSVReader, csv::CSVRow;
int main(int argc, const char** argv)
{
ifstream ifs("test.csv");
for (auto&& row : CSVReader{ifs})
{
const auto ets= row["ets"].get<long>();
cout << ets << endl;
}
}
However, if I read the csv by file name directly, i.e., CSVReader("test.csv"), the program could run normally.
Could you please kindly investigate this issue? Thanks.