Associate information with a pointer address.

BoQsc vaidas.boqsc at gmail.com
Fri Sep 29 07:16:32 UTC 2023


For some reason I thought this was something I wanted to achieve 
and share.

```
import std;
void main()
{
     string variable;
     void * pointeraddress = &variable;
     string[void *] associative;

     associative[pointeraddress] = "someinformation";

     writeln("Hello D ", pointeraddress);
	writeln("Hello D ", associative[pointeraddress]);
}
```

https://run.dlang.io/is/WkQ50H

![img](https://i.imgur.com/pEJT9GR.png)



More information about the Digitalmars-d-learn mailing list