compound-literals

Nested structures/arrays initialization

I have a structure that contains an arrays of another structure, it looks something like this: typedef struct bla Bla; typedef struct point Point; struct point { int x, y; }; struct bla { int another_var; Point *foo; }; I now want to initialize them in the global scope. They are intended as description of a module. I tr...

Difference between cast used in Compound literals and that done on a pointer variable?

Consider the following code: int main() { int *p; ++((int){5}); //compile without err/warning &((int){5}); //compile without err/warning ++((char *)p); //Compile-time err: invalid lvalue in increment &((char *)p); //Compile-time err: invalid lvalue in unary '&' } Why do the Compound Literals do not ...