I'm reading a big csv file into a data structure defined as such:
struct PriceInfo
{
double Open;
double High;
double Low;
double Close;
unsigned int Volume;
unsigned int Time;
std::string Date;
};
So somewhere in my main function, I have this line:
// read contents of datafile by overloading the input operator into a vector of type <PriceInfo> called prices
while (! dataFile.eof())
{
dataFile >> prices
}
The csv file is comma delineated, so I use an extra function to do the parsing, beyond a template and the overloading function (with the following header std::istream& operator>>(std::istream& istream, PriceInfo& priceInfo))to read the data in.
But the problem is that only the first line in the dataFile is being read into prices.
How should I troubleshoot this?
Thanks,
TR