To define a structure type and a structure variable in one statement, put a
declarator and an optional initializer after the type definition. To
specify a storage class specifier for the variable, you must put the storage
class specifier at the beginning of the statement.
For example:
static struct { int street_no; char *street_name; char *city; char *prov; char *postal_code; } perm_address, temp_address;
Because this example does not name the structure data type, perm_address and temp_address are the only structure variables that will have this data type. Putting an identifier after struct, lets you make additional variable definitions of this data type later in the program.
The structure type (or tag) cannot have the volatile qualifier, but a member or a structure variable can be defined as having the volatile qualifier.
For example:
static struct class1 { char descript[20]; volatile long code; short complete; } volatile file1, file2; struct class1 subfile;
This example qualifies the structures file1 and file2, and the structure member subfile.code as volatile.
Related References