##[3] arr = [0, "aa", 2.4];
What can i put instead of ##?
In C#, just for example, i can write:
object[] ar1 = new object[3];
ar1[0] = 1;
ar1[1] = "hello";
ar1[2] = 'a';
and it works. But in D
Object[3] arr0 = [0, "aa", 2.4];
and compiler complains
Le mardi 15 novembre 2011 à 23:15 +, RenatoL a écrit :
> ##[3] arr = [0, "aa", 2.4];
>
> What can i put instead of ##?
>
> In C#, just for example, i can write:
>
> object[] ar1 = new object[3];
> ar1[0] = 1;
> ar1[1] = "hello";
> ar1[2] = 'a';
>
> and it works. But in D
>
> Object[3] arr0
On Wed, 16 Nov 2011 00:30:44 +0100, bioinfornatics wrote:
> this works: --
> import std.string;
> import std.variant;
> import std.stdio;
>
> void main( string[] args ){
> Variant[] array = [ cast(Variant)1u , cast(Variant)"hi",
> cast(Variant)-
RenatoL wrote:
> ##[3] arr = [0, "aa", 2.4];
>
> What can i put instead of ##?
>
> In C#, just for example, i can write:
>
> object[] ar1 = new object[3];
> ar1[0] = 1;
> ar1[1] = "hello";
> ar1[2] = 'a';
>
> and it works. But in D
>
> Object[3] arr0 = [0, "aa", 2.4];
>
> and compiler compl
On Wednesday, November 16, 2011 08:33:04 Dejan Lekic wrote:
> RenatoL wrote:
> > ##[3] arr = [0, "aa", 2.4];
> >
> > What can i put instead of ##?
> >
> > In C#, just for example, i can write:
> >
> > object[] ar1 = new object[3];
> > ar1[0] = 1;
> > ar1[1] = "hello";
> > ar1[2] = 'a';
> >
> >
Ok, tk u all.
I guess this is a very poor approach if we are looking for
performance
On Thursday, November 17, 2011 14:41 RenatoL wrote:
> Ok, tk u all.
> I guess this is a very poor approach if we are looking for
> performance
Mixing types like that in an array is not a normal thing to do. However, if
you're looking to hold a specific number of items of diverse types
(particula