Working with pointers/adresses

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Jul 9 17:38:25 UTC 2020


On Thu, Jul 09, 2020 at 05:24:33PM +0000, matheus via Digitalmars-d-learn wrote:
[...]
> I wonder if the question was more like intended to display the value
> using pointers, ie:
> 
> import std.stdio;
> 
> void main(){
>     int i;
>     readf("%d\n", i);
>     int *p = &i;
>     writeln(*p);
> }
> 
> Because accessing arbitrary memory location seems very weird.
[...]

Unless the goal was to write an OS? ;-)


T

-- 
It only takes one twig to burn down a forest.


More information about the Digitalmars-d-learn mailing list