I've a question about array definition. I've tryed two types of definition:
First definition
uint8_t data_i2c[1] = { 1 };
Second definition
uint8_t data[1];
data[0] = 1;
data[1] = 2;
In the first case I've an array of 1 value, if I add another value(ex. { 1, 2 }; ) I've a compiling error. In the second case I've defined array in the same way, but I've added values in a second time, If I add another value(ex. data[2] = 3; ), I've not a compiling error.
Why this difference?
I've also checked in debug and even if I define:
data[1] = 2;
data[2] = 3;
I can see only data[0] = 1;
I remember that if I define any array I always have and can use value in index 0.
I'm using Atmel Studio as compiler and C language.