警告:逗号表达式的左操作数无效 [英] warning: left-hand operand of comma expression has no effect

查看:127
本文介绍了警告:逗号表达式的左操作数无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到此警告
如何解决它?

i see this warning How to do fix it?

Temp += (Table[i, temp3] - (MSB[i] ^ 0x1));

警告:逗号表达式的左操作数无效

warning: left-hand operand of comma expression has no effect

推荐答案

什么是Table对象?如果是二维数组,则应该写

what is Table object? If it is 2-dimensional array then you should write

Table[i][temp3]

在您的代码中

[i, temp3]

是逗号运算符-计算第一个参数(i),将其忽略并返回temp3,因此如果Table是接受单索引来访问其对象的某种容器,则可以删除i

is a comma operator - it evaluates the 1st parameter (i), ignores it and returns temp3, so you can just drop i if Table is some kind of container that accepts single-index to access its objects

这篇关于警告:逗号表达式的左操作数无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆