Created
October 3, 2023 13:01
-
-
Save run-dlang/808a478f12e7f35a55f31f6b789e7c42 to your computer and use it in GitHub Desktop.
Code shared from run.dlang.io. Run with '-unittest'
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
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