Possible Duplicate:
zero length arrays vs. pointers
Some new compilers throw up compilation error for below case
struct test {
int length;
char data[0];
};
int main(void)
{
char string[20] = {0};
struct test *t;
//Some code
memcpy(string, t->data, 19); //Compilation error
}
However this gets resolved if I do like this.
memcpy(string, &(t->data[0]), 19);
Any reason why some new compilers are enforcing this restriction?
Edited to correct mistakes