I have been trying to declare a string[] with a dynamic amount of elements (in C#). but everything i try gives me an error of some sort.
i have tried
wont compile and gives an error of "Array creation must have array size or array initializer".
will compile but will give an "Object reference not set to an instance of an object" error.
gives a compile error of "Use of unassigned local variable "myString""
none of these seem to work. help please.
i have tried
Code:
string[] myString = new string[];
Code:
string[] myString = null;
Code:
string[] myString;
none of these seem to work. help please.
Comment