Calculating col size of 2-d vector


#1

I need to calculate col size of 2-D vector. I ma trying to calculate it using A[0].size(), but it’s not working


#2

len(A) gives the number of objects in the list i.e., rows.

len(A[0]) gives number of object in each row i,e., columns.


#3

Exactly, why is size not working?


#4

Go for this.
VECTOR:
For row= A.size();
For column=A[0].size();
ARRAY:
For row=sizeof(A)/sizeof(A[0]);
For column=sizeof(A[0])/sizeof(A[0][0]);


#5

I used A.at(0).size(),
It worked for me!!