On Wednesday, 8 July 2020 at 20:33:39 UTC, Paul Backus wrote:
readf("%d\n", i); // read a number
ubyte* p = cast(ubyte*) i; // convert it to a pointer
writeln(*p); // write the data at that address to the
Note that this program will almost certainly crash if you try
to run it, since modern computers do not allow programs to read
and write arbitrary memory locations.
I wonder if the question was more like intended to display the
value using pointers, ie:
int *p = &i;
Because accessing arbitrary memory location seems very weird.