-
Maximum array size?
There appears to be a hard limit to the maximum array size allowed by c compilers of 2 to the 29th.
Can anyone confirm that this is a hard limit (no way to adjust it that is)?
Has anyone ever ran into it before, and if so what did you do? Note that it isn't a simple case of an array of char or some simple type. The actual array declaration is only 256 elements, but each element is a huge structure of structures that in some cases increase in size proportionally to the 256 element array that contains them (geez). I only need to double the index of the array, but doing so kills my compile due to array index size.
I know this is a pretty odd situation, but someone may have ran into something similar sometime (I hope).
-
Don't know about any absolute limit, but you might try compiler options/settings to increase the stack size. Also, is this data allocated within a function? You can try allocating it globally... or allocate it dynamically using malloc for instance. Those might be ways to get around that limit.
-
>There appears to be a hard limit to the maximum array size allowed by c compilers of 2 to the 29th.
There's a hard limit, but it varies with each implementation. Read your compiler's documentation for ways of increasing the stack size, or use heap allocation for your array.