Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

2d vector initialization in cpp

vector<vector<int>> vec( n , vector<int> (m, 0));

where: n is number of ROWS,
	   m is number of COLUMNS
       
So result will be ( Let n = 2, m = 3 )
  	[[ 0, 0, 0],
     [ 0, 0, 0]]
     		   ( 2 x 3 )
 
PREVIOUS NEXT
Tagged: #vector #initialization #cpp
ADD COMMENT
Topic
Name
9+3 =