Alexis Smirnov
Thinking about software




Friday, April 04, 2003
 

Take two days off and listen ;) [Clemens]

VERY cool. The whole Architect's Tour event up on this site.


    

Craig posts a real neat trick to create an array then size isn't known in advance:

A question that comes up occasionally on the mailing lists revolves around how to manipulate arrays of things. The problem is that once created, arrays can't change size. But what if you don't necessarily know how big it'll be right off the bat. Here's my favorite way to deal with arrays.

ArrayList al = new ArrayList();

 

for (loop over some set of things)

{

  al.Add(thing);

}

 

Thing[] things =

  (Thing[]) al.ToArray(typeof(Thing)); more...


    


Subscribe to "Alexis Smirnov" in Radio UserLand. Click to see the XML version of this web page. Click here to send an email to the editor of this weblog.
Site Statistics
© Copyright 2003 Alexis Smirnov.


Last update: 5/6/2003; 5:43:36 PM.

April 2003
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      
Mar   May

Aug 2002