-
optional and arrays
Hi,
I have two questions maybee someone can help me with.
1) How can i make a parameter optional, example in vb I would do myFunc(a as string, optional b as string).
2) How can i redelcar an array example in vb I would do this Dim myarray(4) as string then I could do redim myarray(6).
Any help would be appreciated.
Jeremy
-
1.) The C# Language does not support optional paramaters. You need to overload your methods in order to provide this functionality.
2.) Check out the ArrayList() class. You do not have to explicity re-dimiension your array, the arraylist() will automatically adjust to your adding/removing of objects.