Created
April 12, 2018 10:42
-
-
Save run-dlang/20fff4ebb9a8845f87bbc142110653e0 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
| void main() | |
| { | |
| import std.stdio: write, writeln, writef, writefln; | |
| int[3] s; | |
| int[3] t; | |
| s = t; // the 3 elements of t are copied into s | |
| s[] = t; // the 3 elements of t are copied into s | |
| s[] = t[]; // the 3 elements of t are copied into s | |
| s[1..2] = t[0..1]; // same as s[1] = t[0] | |
| s[0..2] = t[1..3]; // same as s[0] = t[1], s[1] = t[2] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment