Comparing pointers in C and D

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Thu Feb 16 04:01:51 UTC 2023


On 16/02/2023 2:13 PM, Ali Çehreli wrote:
>      int a, b;
>      int *p = &a;
>      int *q = &b + 1;
> 
> As far as I know, that pointer arithmetic applied to a single object is 
> undefined behavior.

@safe will of course prevent this.

So as far as D is concerned its a solved problem ;)


More information about the Digitalmars-d mailing list