allow on stack with betterC
    rikki cattermole 
    rikki at cattermole.co.nz
       
    Tue Oct 23 05:32:14 UTC 2018
    
    
  
On 23/10/2018 6:26 PM, test wrote:
> On Tuesday, 23 October 2018 at 05:23:42 UTC, rikki cattermole wrote:
>> On 23/10/2018 6:20 PM, test wrote:
>>>
>>> scope tmp     = new ubyte[4];
>>>
>>>
>>> Error: TypeInfo cannot be used with -betterC
>>>
>>>
>>> how to bypass this ?
>>
>> new only exists thanks to druntime hooks.
>> So no by-pass. You just can't use it.
> 
> so how to do in pure C code ?  can we use that method in D ?
Yup, call malloc or do the allocation on the stack just like in C.
    
    
More information about the Digitalmars-d-learn
mailing list