I would like to create an object array in C# of undefined length and then populate the array in a loop like so...
string[] splitWords = message.Split(new Char[] { ' ' });
Word[] words = new Word[];
int wordcount = 0;
foreach (string word in splitWords)
{
if (word == "") continue;
words[wordcount] = new Word(word);
wordcount++;
}
However, I get the error... "Array creation must have array size or array initializer"
I'm doing a lot more logic in the foreach loop that I've left out for brevity.