C compound literals, pointer to arrays
I'm trying to assign a compound literal to a variable, but it seems not to work, see: int *p[] = (int *[]) {{1,2,3},{4,5,6}}; I got a error in gcc. but if I write only this: int p[] = (int []) {1,2,3,4,5,6}; Then it's okay. But is not what I want. I don't understand why the error occurrs, because if I initialize it like a array, or use it with a pointer of arrays of chars, its okay, see: int *p[] = (int *[]) {{1,2,3},{4,5,6}}; //I got a error int p[][3] = {{1,2,3},{4,5,6}}; //it's okay char *p[] = (char *[]) {"one", "two"...}; // it's okay! Note I don't understand why I got an error in the