0
点赞
收藏
分享

微信扫一扫

C语言疑难杂症

快乐小鱼儿_9911 2022-03-12 阅读 82
c语言

文章目录

结构体

C 不支持结构体比较。必须通过一一比较所有成员来比较结构体

structs are not valid operands for equality(==), the operands have to be an arithmetic type or a pointer. We can see this from the draft C99 standard section 6.5.9 Equality operators:

One of the following shall hold:

  • both operands have arithmetic type
  • both operands are pointers to qualified or unqualified versions of compatible types;
  • one operand is a pointer to an object or incomplete type and the other is a pointer to a qualified or unqualified version of void; or
  • one operand is a pointer and the other is a null pointer constant.
举报

相关推荐

0 条评论