Compound Literal Values

When the C99 extensions setting is on, the compiler allows literal values of structures and arrays. The following listing shows an example.

Listing: Example of a Compound Literal

#pragma c99 on

struct my_struct {

  int i; 

  char c[2];

} my_var;

my_var = ((struct my_struct) {x + y, 'a', 0});