Creation of an array which length depens on variables not possible?

TheDGuy via Digitalmars-d digitalmars-d at puremagic.com
Sat Dec 26 10:43:51 PST 2015


Why is this not possible?

		GtkAllocation size;
		widget.getAllocation(size);
		this.width = size.width;
		this.height = size.height;

		int[size.width*size.height*3+1] arr;
		this.accumulator = arr;

nor this:

		GtkAllocation size;
		widget.getAllocation(size);
		this.width = size.width;
		this.height = size.height;

		int[this.width*this.height*3+1] arr;
		this.accumulator = arr;

in the constructor?


More information about the Digitalmars-d mailing list