• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

two dimensional array into vector

 
thanvi janu
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,,

How to represent two dimensional array in vector?

Thanks in Advance,
Thanvi,
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> How to represent two dimensional array in vector?

define a 'two dimensional array' and the answer will stand out
 
Campbell Ritchie
Sheriff
Pie
Posts: 49367
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael Dunn wrote:define a 'two dimensional array'
If only people were taught there is no such thing as a 2D array in the first place.

Look at this Java™ Tutorials page and see what it says when you use ctrl-f "multidimensional".
 
Campbell Ritchie
Sheriff
Pie
Posts: 49367
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way, I think this is not the correct forum for this thread. I presume Maneesh or Rob will move it.
 
Rob Spoor
Sheriff
Pie
Posts: 20545
56
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Java in General.

A multidimensional Vector is nothing more than a Vector of Vectors (of Vectors etc): Vector<Vector<X>>. Unlike with multidimensional arrays* you will need to initialize the inner Vectors manually.


* There actually is no such things. A multidimensional array is also nothing more than an array of arrays (of arrays etc). The only difference with a multidimensional Vector is that multidimensional arrays have a shortcut in syntax for creating them.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic