Greetings...
I am trying to get a 2-d vector filled with a records form a dataset.
this is what I have:
int StudentNum = 1, rflds;
TDataSet *Students = DSet;
String stu;
rflds = Students->FieldCount; //Number of fields in the dataset
vector< vector<String> > dataset(Students->RecordCount, vector<String>());
while (StudentNum <= Students->RecordCount)
{
Students->RecNo = StudentNum;
for (int i = 0; i <= rflds-1; i++)
{
stu = Students->Fields->Fields[i]->AsString;
dataset[StudentNum][i] = stu;
}
StudentNum++;
}
I can fill a 1-D vector with no issue.
After I get that done, I will want to find the longest element for each of the vectors dataset[StudentNum], or the longest element in say dataset[StudentNum][2]. I assume you use dataset[StudentNum][2].size()...
If you can answer both that would be great
Thank you so much
Lee