Hi,
What is the purpose of using empty structures in C? I know this is only a gcc extension.
Thanks,
Printable View
Hi,
What is the purpose of using empty structures in C? I know this is only a gcc extension.
Thanks,
Read the gcc extension to discover why they think it's a good idea (perhaps)?
Not much info regarding this extension. http://developer.apple.com/documenta...pty-Structures
I would like to know why someone would use an empty structure, you cannot assign anything...
It may on occasion allow
If both conditions were false, then the structure would be empty.Code:struct foo {
#ifdef SOMETHING
int a;
#endif
#ifdef SOMETHING_ELSE
int b;
#endif
};
Without the extension, you might struggle to declare a minimally 'empty' struct containing only one char to make the compiler shut up.