Skip to content

Instantly share code, notes, and snippets.

@run-dlang
Created October 3, 2023 13:01
Show Gist options
  • Save run-dlang/808a478f12e7f35a55f31f6b789e7c42 to your computer and use it in GitHub Desktop.
Save run-dlang/808a478f12e7f35a55f31f6b789e7c42 to your computer and use it in GitHub Desktop.
Code shared from run.dlang.io. Run with '-unittest'
void main()
{
import std.algorithm, std.stdio;
"Starting program".writeln;
int[] a = new int[5];
a = [1, 5, 3, 6, 9];
for (int i; i < a.length; i++)
writeln(a[i]);
a.length = 7;
for (int i; i < a.length; i++)
writeln(a[i]);
// Print the result _during_ compilation
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment