Re: What's the most efficient way to transform a 2d array into a 2dvector
On Fri, 04 Apr 2008 11:43:10 -0700, xz wrote:
>But if you wanted that why would
>you start off with a plain 2D array in the first place.
>
>
If you wanna initialize a 2D vector (12x2) with the following data:
>
-5, -5,
-5, 105,
105, 105,
105, -5,
60, -5,
60, 40,
70, 40,
70, 60,
30, 60,
30, 40,
40, 40,
40, -5,
>
>
How do you do that?
Re: What's the most efficient way to transform a 2d array into a 2dvector
On Apr 4, 11:43 pm, xz <zhang.xi...@gm ail.comwrote:
But if you wanted that why would
you start off with a plain 2D array in the first place.
>
If you wanna initialize a 2D vector (12x2) with the following data:
>
-5, -5,
-5, 105,
105, 105,
105, -5,
60, -5,
60, 40,
70, 40,
70, 60,
30, 60,
30, 40,
40, 40,
40, -5,
>
How do you do that?
If that is the case, then why do you want to use a vector at all? Why
don't you work with the arrays only or something like boost:array?
vectors are not a complete replacement of arrays especially when
arrays know their size (and they don't grow) and elements at the time
of creation.
>
If that is the case, then why do you want to use a vector at all? Why
don't you work with the arrays only or something like boost:array?
vectors are not a complete replacement of arrays especially when
arrays know their size (and they don't grow) and elements at the time
of creation.
What if I want to use some function that reads vector instead of
array?
Comment