Would vector of vectors be contiguous?
- by user1150989
I need to allocate a vector of rows where row contains a vector of rows. I know that a vector would be contiguous. I wanted to know whether a vector of vectors would also be contiguous. Example code is given below
vector<long> firstRow;
firstRow.push_back(0);
firstRow.push_back(1);
vector<long> secondRow;
secondRow.push_back(0);
secondRow.push_back(1);
vector< vector < long> > data;
data.push_back(firstRow);
data.push_back(secondRow);
Would the sequence in memory be 0 1 0 1?