changing array lengths

2008-12-09 Thread Ellery Newcomer
Does the following totally not make sense? I think it should work. int[] a = new int[10]; a.length += 30;

Re: changing array lengths

2008-12-09 Thread Jarrett Billingsley
On Tue, Dec 9, 2008 at 11:54 PM, Ellery Newcomer <[EMAIL PROTECTED]> wrote: > Does the following totally not make sense? I think it should work. > > int[] a = new int[10]; > > a.length += 30; > It's a weird limitation that's been around forever. Ugh. Here, have this. T[] resize(T)(ref T[] arr,

Re: changing array lengths

2008-12-10 Thread Derek Parnell
On Tue, 09 Dec 2008 22:54:30 -0600, Ellery Newcomer wrote: > Does the following totally not make sense? I think it should work. > > int[] a = new int[10]; > > a.length += 30; Unfortunately, the .length property, like all properties, do not support the 'op=' syntax. You have to do it the long wa