I’ve searched around and haven’t found an answer to this. What I would like to know is this:
If I declare a static unsigned char const ARRAY[256] = { [0] = <some_value> };,
can I expect the unspecified elements (in this case all but the element at index 0) to have a certain value, or will they be random?
I need this for a constant lookup table that won’t have all elements filled, but isn’t too large, so wasting some space isn’t a problem.
Suggestions for more appropriate data types or conventions are welcome.
Thanks!
The rest of the array will be initialized to zero.
Also, you may initialize more than one element in the array, for example:
will create and initialize the array arr to: