表达式求值是编程中的一个错误
Expression evaluation an error in programming
正在计算表达式
2+3/2++
编译器给出错误
错误 1 error C2100: 非法间接寻址
错误 2 error C2105: '++' 需要左值
IntelliSense:表达式必须是可修改的左值
IntelliSense:“”的操作数必须是指针
谁能给我解释一下。
不能对数字使用 ++ 运算符。
2++
没有意义。这与将值 3 分配给 2 相同,例如
2 = 3 // Can't do that
你需要一个变量才能使用++
int a;
a = 2;
a++; // Now a holds the value 3
正在计算表达式
2+3/2++
编译器给出错误
错误 1 error C2100: 非法间接寻址
错误 2 error C2105: '++' 需要左值
IntelliSense:表达式必须是可修改的左值
IntelliSense:“”的操作数必须是指针
谁能给我解释一下。
不能对数字使用 ++ 运算符。
2++
没有意义。这与将值 3 分配给 2 相同,例如
2 = 3 // Can't do that
你需要一个变量才能使用++
int a;
a = 2;
a++; // Now a holds the value 3