2D vectors

can i do something like this, like in arrays?
thanks

1
2
3
4
5
  vector< <vector<int> > LN ={
                            {1,1,2,2,},
                             {2,2,1,2,},
                             {3,5,2,5,},
                             {1,1,2,3,}};
Yes you can, here's your code running as-is (except I removed the extraneous < character): http://ideone.com/QRvKM3
Thanks Sir Cubbi, a question though...why do most people do this thing you did, std:: vector, std:: string... std:: bla bla bla.... i hope my doing using namespace std exempts me from doing that...or do i have to do it too for codes to run better or something? thanks
but is there no material somewhere which teaches how to loop over 2d vectors and how to manage them in general? thanks...over here i found only one d...
Last edited on
@donvigor

I just did this, posted it here to save Cubbi some time (I think he is busy enough as it is!)

http://www.cplusplus.com/forum/beginner/106731/#msg578028


Hop all is well.
Topic archived. No new replies allowed.