comparison between signed and unsigned integer expression s [-Werror=sign-compare]
ret[i].Id 是unsigned int 型,min_index是int,不能直接比较

但将min_index直接定义为unsigned 类型,-1是有符号的,在min_index == -1又是同样的错误,因此直接将比较中的-1也强制转为unsigned类型,如下图
comparison between signed and unsigned integer expression s [-Werror=sign-compare]

相关文章:

  • 2022-12-23
  • 2021-12-31
  • 2021-07-31
  • 2021-08-12
  • 2022-01-28
  • 2021-08-24
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-14
  • 2021-11-14
  • 2022-12-23
  • 2021-07-11
  • 2021-10-23
  • 2022-12-23
相关资源
相似解决方案