| i want to check the size of row 5..and how many integers it contains...how do i ask for that?.. |
holder[4].size();| holder.size()..is surely not enough right??? that will give me the size of the whole 2d i think |
holder is a vector. Each element of the vector is a row. (A "row" is, in fact, another vector, but that's not important right now.) So holder.size() will give you the number of elements in holder - i.e. the number of rows. |
|
|
|
holder is a single vector of rows.
holder is really the entire 2-dimensional "table". It contains all the rows, which in turn contain all the integers.holder[i] is a single "row". It contains all the integers in that row.holder[i][j] is a single element - that is, a single integer. |
|
|
|
|
|
|
|