c++ - How do I iterate through a two dimensional vector -
To be repeated and printed through the use of a single dimensional vector,
Vector & lt; Integer & gt; a; For (vector = lieutenant> gt; :: iterator = a.begin (); this & lt; a.end (); it ++) cout & lt; & Lt; * this; How do I do this for a two-dimensional vector?
Or ever since we are using C ++ 11 ... < Previous> #include & lt; Iostream & gt; #include & lt; Vector & gt; using namespace std; Int main () {Vector & lt; Vector & lt; Int & gt; & Gt; V = {{1,2}, {3,4}}; For (Const Auto and Inher: v) {For (Cost Autos and Item: Inner) {cout & lt; & Lt; Item & lt; & Lt; ""; }} Cout & lt; & Lt; Endl; Return 0; }
Comments
Post a Comment