المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : creating dynamic array



C# Programming
02-13-2010, 09:29 AM
i notice that in c# or c++, we normally indicate the size of an array.
string[] strArray = new string[5];
strArray[0] = "Ronnie";
strArray[1] = "Jack";
strArray[2] = "Lori";
strArray[3] = "Max";
strArray[4] = "Tricky";


Another way is like this:
string[] strArray = new string[] {"Ronnie", "Jack", "Lori", "Max", "Tricky"};

Both have fixed size. is there a way to create an array which can store unlimited amount of data?

I know of ArrayList but it is not available in compact framework.