Dyanamic size of Array
-
How can i declare/create a array, which have dynamic size. i mean dynamically the no of elements in array varies,.. Can u pls help me,. I want a string array of such kind.
-
How can i declare/create a array, which have dynamic size. i mean dynamically the no of elements in array varies,.. Can u pls help me,. I want a string array of such kind.
That's what collections are there for. In C# 2.0:
Collection dynamicArray = new Collection();
In C# 1.x: Use a collection generator to create a typesafe collection. _________________________________ Please inform me about my English mistakes, as I'm still trying to learn your language! -
How can i declare/create a array, which have dynamic size. i mean dynamically the no of elements in array varies,.. Can u pls help me,. I want a string array of such kind.
Arrays can't be dynamic. Resizing an array means declaring a new array and copy all the elements to the new array. This is expensive, so there is intentionally no built in method to do this. There are many different collections that you can use depending on what you need, like ArrayList, HashTable, Queue, SortedList, et.c. --- b { font-weight: normal; }