for (int w=0;w<10;w++)
{
//some lines of code
unsigned long num = x.to_ulong();
cout <<"Decimal form is: " << num<< end;
// if we've hit 15 items in the current row (i.e. 15 columns), then shift to the next row
if (row->size() == 15)
++row;
// add this to the next column in the current row
row->push_back(num);
}
// resize the last row
row->resize(15); // this will ensure that there are 15 columns in the last row