I am trying to create a Vector of Vectors of CStrings; a two dimensional array of CStrings. This will represent the data in a table. (All data is a CString of course).
Here is how I try to initialize the Vector>
std::vector<std::vector<CString>> tableData;
for(int r = 0; r < oTA.rows; r++)
for(int c = 0; c < oTA.cols; c++)
tableData[r][c] = "Test";
And here is how I try to use it
for(int r = 0; r < tabAtt.rows; r++)
{
// TextYpos = bottom of table + 5(padding) + (row height * row we're on)
HPDF_REAL textYpos = tabAtt.tabY + 5 + (r*tabAtt.rowH);
for(int c = 0; c < tabAtt.cols; c++)
{
// TextXpos = left of table + 5(padding) + (col width * col we're on)
HPDF_REAL textXpos = tabAtt.tabX + 5 + c*tabAtt.colW;
HPDF_Page_TextOut (page, textXpos, textYpos, (CT2A)tableData[r][c]); // HERE!
}
}
But I think that I am not initializing it properly. I keep getting a vector out of bounds error.