This is an ad.
struct A; is a forward declaration or an incomplete declaration.
struct A { int a; char b; float c; };
is a complete struct declaration.
Example
Also check comp.lang.c FAQ list Question 11.5
After directly declaring a struct you can use pointers to the structure, but you cannot dereference pointers or use the sizeof operator or create instances of struct .
After the declaration, you can also use struct objects, apply the sizeof operator, etc.
From 6.7.2.1 Structure and Association Qualifiers from C11 Specifications
8 Type is incomplete until immediately after it completes the list and complete after that.
And from 6.7.2.3 Tags
If a form type specifier exists
structure or union identifier except as part of one of the above forms, and no other declaration of the identifier as a tag, then it declares an incomplete structure or union, and declares the identifier as a tag of this type. 131 )
131 A similar listing design does not exist.
This should not be confused with extern struct A aa; v / s struct A aa ={/*Some values*/}; which are the declaration and definitions of the object aa .
source share