Dup'ing an array onto the stack

John Demme me at teqdruid.com
Fri Feb 24 22:02:37 PST 2006


That's the code I was looking for.  Thanks.

~John Demme

Tom S wrote:

> John Demme wrote:
>> But it's a lie, since stackStr is stored on the heap.  How do I get it on
>> the stack?  I can easily get the space on the stack for it using
>> alloca(), but how do I tell the array to use a certain place in memory?
> 
> How about:
> 
> char[] foo = (cast(char*)alloca(...))[0 .. bar.length];
> foo[] = bar[];
> 
> ?
> 
> 




More information about the Digitalmars-d-learn mailing list