I got the compile error message "Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)" when I tried to declare an array of linked lists.
public LinkedList<LevelNode>[2] ExistingXMLList;
Also, if I wanted to create a small array of strings, isn't the following the correct way?
string [2] inputdata;
You declare an array with just [].
LinkedList[] XMLList;
Then you instantiate it with the size.
XMLList = new LinkedList[2];
Or both at the same time:
LinkedList[] XMLList = new LinkedList[2];
To add LinkedLists to this array you type:
XMLList[0] = new LinkedList();
XMLList[1] = new LinkedList();
try this:
LinkedList[] ExistingXMLList = new LinkedList[2];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With