I've seen both full definitions of struct
s in headers and just declarations—is there any advantage to one method over the other?
If it makes a difference, I usually typedef a struct like so in the .h
typedef struct s s_t;
To be clear, the options are declaration in the header file and definition in the class, or both declaration and definition in the header file. Both should result in the same usability, even if one is by linkage, shouldn't they?
I see many almost duplicates, e.g. here but no exact matches. Please correct me if I'm wrong in this regard.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…