Multidimensional Box arrays

Myron Alexander someone at
Fri Feb 2 08:05:47 PST 2007


I seem to have solved my problem. I'm not sure what I am doing differently but it seems to work now :)

import std.stdio;
import std.boxer;

void main() {
	writefln ("Boxing day");

	Box[] a = boxArray(25, "Hello World", 1337);
	Box[] b = boxArray("X", "Y", 42);

	Box[][] ab = [a,b];

	writefln ("%d, %s, %d", unbox!(int)(ab[0][0]), unbox!(char[])(ab[0][1]), unbox!(int)(ab[0][2]));
	writefln ("%s, %s, %d", unbox!(char[])(ab[1][0]), unbox!(char[])(ab[1][1]), unbox!(int)(ab[1][2]));



More information about the Digitalmars-d-learn mailing list