You can use an anonymous structure, like this:
struct {
int memberA, memberB;
} my_struct;
my_struct.memberA = 1;
my_struct.memberB = 2;
printf("%d %d\n", my_struct.memberA, my_struct.memberB);
Domanda
is there some way to define static structure that is already one and only instance of itself? Like the way you can do it with the struc keyword in nasm?
Soluzione
You can use an anonymous structure, like this:
struct {
int memberA, memberB;
} my_struct;
my_struct.memberA = 1;
my_struct.memberB = 2;
printf("%d %d\n", my_struct.memberA, my_struct.memberB);