I have an array declared in my header file like this:
int snapshot[kSnapshotSize];
which I would really love to init like this in my implementation file:
snapshot[kSnapshotSize] = {[0 ... kSnapshotSize-1] = 5};
however the compiler complains: "Expected expression"
Can anyone tell me what I'm doing wrong?
UPDATE: int snapshot[kSnapshotSize] = {[0 ... kSnapshotSize] = 5}; seems to work, so probably I'm missing something basic. I think I can use memset, but would first want to be sure this is not possible (and why)
UPDATE 2: As many of you pointed out, it seems that it's only possible to init an array like that not to populate it later. I end up using a for loop.