Declaring vectors

Hi,

I am declaring vectors in this way

1
2
3
4
    vector<vector<double> > matrix;
    matrix.resize(cols);
    for(int i = 0; i < cols; i++)
        matrix[i].resize(lines);


Is there a simple way I can setup the size of a matrix?

Some thing like

 
vector<vector<double> > matrix[lines][cols];
You can use constructors: vector< vector<double> > matrix( cols , vector<double>( lines ) );
Thanks Bazzy,

that was what I want.
Topic archived. No new replies allowed.