vincentlaucsb / csv-parser

A high-performance, fully-featured CSV parser and serializer for modern C++.
MIT License
901 stars 150 forks source link

"expected unqualified-id before ‘for’ " An error occurs.... #172

Closed MickeyDragon closed 3 years ago

MickeyDragon commented 3 years ago

`# include "csv.hpp"

using namespace csv;

CSVReader reader("very_big_file.csv"); double sum = 0;

for (auto& row: reader) { // Note: Can also use index of column with [] operator sum += row["Total Salary"].get(); }`

I was testing the example using a header-only .hpp file...

by the way for (auto& row: reader) The expected unqualified-id before 'for' error appears here....

I don't know what to do.

im sorry.... `# include "csv.hpp"

using namespace csv;

CSVReader reader("eurusd.csv"); double sum = 0;

int main() { for (auto& row: reader) { // Note: Can also use index of column with [] operator sum += row["Total Salary"].get(); } } `