What can you "new"
Unknown W. Brackets
unknown at simplemachines.org
Tue Mar 24 01:24:07 PDT 2009
Yes, well, the question was about new not about arrays...
-[Unknown]
Steven Schveighoffer wrote:
> On Sun, 22 Mar 2009 18:43:58 -0400, Unknown W. Brackets
> <unknown at simplemachines.org> wrote:
>
>> The new construct allocates memory. You can "new" anything that
>> requires a set amount of memory.
>>
>> This is equivalent to what you want:
>>
>> auto s = new char[0];
>
> Also can be:
>
> char[] s;
>
> Which creates a new array of 0 length also.
>
> -Steve
More information about the Digitalmars-d
mailing list