R
rmathieu
Hi, I want to initialize a static String array in MC++. What I want to
do is to initialize my String array like the C# way: new String[]
{"11", "22"} but I could not find an equivalent in MC++. The onlu
thing I can do is this: new String*[2] but I cannot specified any
initial values... Did someone have any ideas???
Here is an example of what I want to do:
C#
struct TestingStruct
{
public String a;
public String[] b;
public TestingStruct( String aa, String[] bb )
{
a = aa;
b = bb;
}
};
TestingStruct[] Test1 =
{ new TestingStruct("abc", new String[] {"11", "22"}),
new TestingStruct("def", new String[] {"33", "44"})
};
MC++
__gc struct TestingStruct
{
String* a;
String* b[];
TestingStruct( String* aa, String* bb[] )
{
a = aa;
b = bb;
}
};
static TestingStruct* Test1[] =
{ new TestingStruct("AF", new String*[2]), // This is working but
how can I add initial values???
new TestingStruct("BC", new String*[2]) // This is working but
how can I add initial values???
};
Any help will be appreciated...
Remi
do is to initialize my String array like the C# way: new String[]
{"11", "22"} but I could not find an equivalent in MC++. The onlu
thing I can do is this: new String*[2] but I cannot specified any
initial values... Did someone have any ideas???
Here is an example of what I want to do:
C#
struct TestingStruct
{
public String a;
public String[] b;
public TestingStruct( String aa, String[] bb )
{
a = aa;
b = bb;
}
};
TestingStruct[] Test1 =
{ new TestingStruct("abc", new String[] {"11", "22"}),
new TestingStruct("def", new String[] {"33", "44"})
};
MC++
__gc struct TestingStruct
{
String* a;
String* b[];
TestingStruct( String* aa, String* bb[] )
{
a = aa;
b = bb;
}
};
static TestingStruct* Test1[] =
{ new TestingStruct("AF", new String*[2]), // This is working but
how can I add initial values???
new TestingStruct("BC", new String*[2]) // This is working but
how can I add initial values???
};
Any help will be appreciated...
Remi