Reading a CSV file into an array of struct problem

Hi, new to this and have looked through previous posts to see if I can make sense of what’s going wrong but to no avail, any help would be appreciated.

I am attempting to read csv data into an array of struct.
The csv data has the following form:

11/05/2010;12:37:01;36;687;686.7;686.7;687.23

I’ve setup my struct as follows:

struct infile_t {
string Day;
string CaptureTime;
int Volume;
float Open;
float Close;
float Min;
float Max;
} DataArr[2000];

I read in each csv value and attempt to append it to the corresponding members of the struct as follows:
getline(b_file,DataArr[i].Day,';');
getline(b_file,DataArr[i].CaptureTime,';');
getline(b_file,mystr,';');
stringstream(mystr) >> DataArr[i].Volume;
getline(b_file,mystr,';');
stringstream(mystr) >> DataArr[i].Open;
getline(b_file,mystr,';');
stringstream(mystr) >> DataArr[i].Close;
getline(b_file,mystr,';');
stringstream(mystr) >> DataArr[i].Min;
getline(b_file,mystr);
stringstream(mystr) >> DataArr[i].Max;

however, if I try to print the contents of say the first set of elements in the struct I get the following:

11/05/2010
12:37:01
0
0
0
0
0

I am assuming that there’s problem with my attempt to convert the string into an integer/float data type?
Could someone point me in the right direction?

Thanks
Topic archived. No new replies allowed.