Vector of vector

i have dougt in this Q
i am not getting this

paste the question here in which you have issue in understanding.

The statement vector< vector< int > > matrix(100, vector < int > (50, 100) ) declares :

vector < int > (50, 100) declares a vector X of type int with 50 elements each initialized to 100 and matrix consists of 100 vectors of type int each equal to X.

The statement will result in a compile-time error.

vector (50, 100) declares a vector X of type int with 100 elements each initialized to 50 and matrix consists of 100 vectors of type int each equal to X.

The statement will result in a run-time error.

it is quiz Questionnnnnnnnnnnnnnnnnnnnnnnnnnnnn

I don’t have access to the quiz. So you have to paste entire question with options here so that i can tell you which one is correct option. So just copy the question with option and paste here , rest I’ll do.

The statement vector< vector< int > > matrix(100, vector < int > (50, 100) ) declares :

1.vector < int > (50, 100) declares a vector X of type int with 50 elements each initialized to 100 and matrix consists of 100 vectors of type int each equal to X.

2.The statement will result in a compile-time error.

3.vector (50, 100) declares a vector X of type int with 100 elements each initialized to 50 and matrix consists of 100 vectors of type int each equal to X.

4.The statement will result in a run-time error.

Correct answer should be option 1 as, it Declares a 2D matrix of size 100*50 and each cell is initialised with value=100 i.e mat[I][j]=100 for all i in[0,100), and for all j in [0,50).

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.