DMD 0.177 release

Chris Miller chris at dprogramming.com
Sat Dec 9 08:39:36 PST 2006


On Sat, 09 Dec 2006 11:33:17 -0500, Alexander Panek  
<a.panek at brainsware.org> wrote:

> char *newCharz( uint size ) {
> 	return (new char [size]).ptr;
> }
>
> char *p = newCharz(32);
>
> :P
>
> I like the explicity.

Well, I'm not sure what it should be, but you already made a mistake: it  
should be size_t instead of uint ;)

Plus, I never said it was a zero-terminated string.

>
> Chris Miller wrote:
>>  char* p = new char[32];
>>  Error: cannot implicitly convert expression (new char[](32)) of type  
>> char[] to char*
>>  Should this be a special case? Currently it needs  (new char[32]).ptr




More information about the Digitalmars-d-announce mailing list