initialize variable as global

Hello everybody.
I try to handle a matrix in my programm. I still reached to declare this matrix as a two dimensional vector in a testprogramm as follows:



vector < vector <double> > B(Num_Rows);  

for( int i = 0; i < Num_Rows; i++ )
       B[i].resize(Num_Col);




Everything works there fine and I can call the matrix by B[i][j]. For my main programm, I right now need to declare this matrix B globally (without any knowledge of the size of rows and cols). And afterwards, somewhere inside the programm I read out the Num_Rows and Num_Cols and have to change the size and fill in entries.

My main question is how to declare this matrix B global without knowing the final size.

I would be happy if you can help me.
Last edited on
hey guys...
nobody there who can help me?
You don't need to know the final size. You can declare it with a size of 1 and then resize it later.
vector<vector<double> > B;

Edit: too late again :|
Last edited on
Topic archived. No new replies allowed.