Skip to content

Instantly share code, notes, and snippets.

@run-dlang
Created September 29, 2023 13:04
Show Gist options
  • Save run-dlang/0dfaf0bc2a08ff1630edc838ee894769 to your computer and use it in GitHub Desktop.
Save run-dlang/0dfaf0bc2a08ff1630edc838ee894769 to your computer and use it in GitHub Desktop.
Code shared from run.dlang.io.
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