Ok so i managed to learn vectors..one d...then now how to create 2d..fantastic..i can easily move up and down the 1D vector...but nowhere on this site am I finding how to iterate over a 2d vector like i do iterate over my array matrix...
can someone give me a good tutorial? thanks...i wish to be able to do all the iteration i do on an array matrix on a 2D vector too...any link or site with a good tutorial and nice examples will be very much appreciated..thanks..
haha am not understanding anything...some more comments...is the very first time..take it like i just heard about vectors yesterday...can you give comments and do step by step explanation like you're explaining to a five year old? thank you? iomanip? well am gonna read about that..typedef ecc? why std infront of everything...can't i do without it?
If you understand a 1 dimensional vector, then it shouldn't be that much of a reach. A 2 dimensional vector is simply a vector which contains more vectors. You iterate over the outer vector (the outer for loops above) to get to the inner vectors which you then iterate over to get your data (the inner for loops above.)
Lines 36 to 41 above should look rather like how you would access a 2d array. I suspect that is what you were after.
std::setw sets the minimum field width for the next output operation.
why std infront of everything...can't i do without it?
You could with an appropriate using directive (or directives.) As for the 'why', because it is a good practice.