Why are structs not allowed in equality expressions in C? [duplicate]
问题 This question already has answers here : Why doesn't C provide struct comparison? (5 answers) Closed 2 years ago . The unavailability of structs as comparison operands is one of the more obvious things in C that don't make too much sense (to me). structs can be passed by value and copied via assignments but == is not specified for them. Below are the relevant parts of the C11 standard (draft) that define the constraints of the equality operators ( == and != ) and the simple assignment