std::vector push_back

Hello.
I have a little problem regarding vectors.
I have a class with a element std::vector<std::vector<Tile> >, the class has a method to populate the vector. The "Tile" has a copy constructor and everything. After the call of the function, it has the needed number of rows, but the "row" vectors are empty. What could cause this? Maybe there is a better way to handle a 2D array of objects?
Thank you!

1
2
3
4
5
6
  array=std::vector<std::vector<Tile> >(rows);
    for(int i=0;i<rows;i++){
        for(int j=0;j<columns;
            Tile *tempTile=new Tile(x,y,TILE_WIDTH, TILE_WIDTH);
            array[i].push_back(*tempTile);
        }
why don't you have an increment statement in your for loop ?
Topic archived. No new replies allowed.