Re: static array crashes my program

2015-12-05 Thread John Colvin via Digitalmars-d-learn
On Saturday, 5 December 2015 at 09:49:06 UTC, ref2401 wrote: 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 :)

Re: static array crashes my program

2015-12-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/5/15 8:09 AM, John Colvin wrote: On Saturday, 5 December 2015 at 09:49:06 UTC, ref2401 wrote: 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

static array crashes my program

2015-12-05 Thread ref2401 via Digitalmars-d-learn
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; //

Re: static array crashes my program

2015-12-05 Thread Olivier Pisano via Digitalmars-d-learn
On Saturday, 5 December 2015 at 09:49:06 UTC, ref2401 wrote: 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 :)