Always:
import std.c.stdio;
int main() {
int x = 7;
int* p = &x;
printf ("%d\n", *(p + 1));
return 0;
}
This compiles in D and violates memory safety.If you prefer a documentation answer(https://dlang.org/spec/arrays.html#pointers) These are simple pointers to data, analogous to C pointers. Pointers are provided for interfacing with C and for specialized systems work. There is no length associated with it, and so there is no way for the compiler or runtime to do bounds checking, etc., on it.