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:
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?