I'm trying to read in a .csv file filled with strings for a program that I have. I wrote the code below to try to read each individual string.
string read_from_f(istream &in) {
string a;
char fill = '0';
while (fill != ',') {
in.get(fill);
if (fill != ',') {
a += fill;
}
}
return a;
}
This ends up not working because some of my strings have comma's in them and are structured like this. "........", "Donald, Trump", "....."
When I look at my locals when I debug, in.get() does not read in the double quotes from each string. Is there a way that I can read from quotes to quotes so I don't get any unexpected errors?