Is the omission of a forward declaration for a pointer to a structure valid? [duplicate]
问题 This question already has answers here : How is it legal to reference an undefined type inside a structure? (7 answers) Closed last month . I recently came across this comment by @Paul Ogilvie: "You say "To define a pointer to a structure you only need to know the structure tag". In my experience that is unnecessary. Just declare a pointer_to_some_type and the compiler will reserve space for a pointer and does type checking on assignment. Only once you want dereference the pointer and access