Created
September 29, 2023 13:04
-
-
Save run-dlang/0dfaf0bc2a08ff1630edc838ee894769 to your computer and use it in GitHub Desktop.
Code shared from run.dlang.io.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std; | |
void outofcontext() | |
{ | |
writeln("Hello D ", associative); | |
foreach (pointeraddress, information; associative) | |
{ | |
writeln(*cast(string*)pointeraddress); | |
} | |
} | |
static string[void*] associative; | |
void main() | |
{ | |
writeln("Hello D ", associative); | |
string variable = "hi"; | |
associative[&variable] = "someinformation"; | |
outofcontext(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment