M
mattias.k.nyberg
So Im trying to learn to program with C#. And I have this question
about why the string array won't work in the first class but it does in
the second. To me it looks like they do the exact same thing.
class Test
{
string[] words;
public Test() {
words = { "", "", "" }; // This doesn't work
}
}
class Test2
{
string[] words;
public Test2() {
words = new string[3]; // This works
}
}
about why the string array won't work in the first class but it does in
the second. To me it looks like they do the exact same thing.
class Test
{
string[] words;
public Test() {
words = { "", "", "" }; // This doesn't work
}
}
class Test2
{
string[] words;
public Test2() {
words = new string[3]; // This works
}
}