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 )
Source by www.techiedelight.com #
 
PREVIOUS NEXT
Tagged: #vector #initialization #cpp
ADD COMMENT
Topic
Name
4+1 =