ABI array format

Walter Bright newshound1 at digitalmars.com
Wed Dec 19 21:05:02 PST 2007


Kenny B wrote:
> Walter Bright wrote:
>> Kenny B wrote:
>>> Why then, is
>>> the ABI for the arrays in reverse order...
>>>
>>> (length, pointer)
>> It was so you could pass a D string to printf and print using the %.*s
>> format.
> 
> that's what I figured. printf has almost completely been phased out. is
> it possible that this format can be reversed when printf is a thing from
> the past?

I recommend treating array contents as an opaque type, and call the C 
functions using array.ptr and array.length. That way, you'll be insured 
against implementation changes.



More information about the Digitalmars-d mailing list