changing array lengths

Derek Parnell derek at psych.ward
Wed Dec 10 00:35:45 PST 2008


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 way ...

 a.length = a.length + 30;

-- 
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell


More information about the Digitalmars-d-learn mailing list