In my recent operating systems class we have a bunch of objects defined as such:
typedef struct someobj {
... stuff ...
} someobj_t;
I know what that does just fine.
The question is that sometimes in the given support code the structs were refered to as struct someobj *some, and sometimes as someobj_t *some. Is there an actual / useful reason to refer to structs in these two different ways, or is just a stylistic difference?
Assuming we’re asking about the following code (there’s no
typedefin the question as I’m writing, but I’m assuming it was meant to be there):Actually usually it’d be sufficient to omit the name
someobjand usesomeobj_tconsistently. However there’s that situation when you want the struct to refer to itself: