core.stdc.stdlib._compare_fp_t and qsort

Dmitry Olshansky dmitry.olsh at gmail.com
Sun Mar 18 18:32:48 UTC 2018


On Sunday, 18 March 2018 at 18:11:02 UTC, Dmitry Olshansky wrote:
> On Sunday, 18 March 2018 at 16:45:16 UTC, Joe wrote:
>> [...]
>
> No it just creates a pair of pointer to recs[0] + length of 
> recs, like this:
>
> struct Array
> {
>   size_t length;
>   Record* ptr;
> }
>
> In D it’s typed as Record[] and has a number of nice 
> properties, like not losing its length;)
>
>> [...]
>
> Well since recs is array of pointers this looks like a null 
> pointer in your data.

Or rather if 10 is capacity and num_recs is actual length, then:

recs[0..num_recs] is the slice with data that you want to sort.




More information about the Digitalmars-d-learn mailing list