static array crashes my program

ref2401 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Dec 5 01:49:06 PST 2015


I want to create a static array large enough to store 1MB of 
float values.
What am I doing wrong?
Here is a sample code with notes:

void main(string[] args) {
	enum size_t COUNT = 1024 * 512 / float.sizeof; // works OK :)
	//enum size_t COUNT = 1024 * 512 * 2 / float.sizeof; // 
constantly crashes :(
	float[COUNT] arr;
	writeln(arr.length);
}

DMD: 2069.2
OS: Win 8.1 Pro


More information about the Digitalmars-d-learn mailing list