Strange behavior of array

VlasovRoman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Oct 15 19:39:15 PDT 2015


I get it in dmd 2.068.2 and dmd 2.069-b2. I think, that this 
behavior some strange:

I have some code:

enum int m = 10;
enum int n = 5;

ubyte[m][n] array;
for(int x = 0; x < m; x++) {
	for(int y = 0; y < n; y++) {
		array[x][y] = cast(ubyte)(x + y);
	}	
}

In runtime i get range violation error. Helps to change the index 
when accessing the array. What I don't understand?

Thanks.


More information about the Digitalmars-d-learn mailing list