1. 操作符的含义——该操作符执行什么操作以及操作结果的类型——取决于操作数的类型。
2. 数组通过指针赋值
int ia[10];
ia[0] = 0; // ok: subscript is an lvalue
*ia = 0; // ok: dereference also is an lvalue
int ival; int *pval;
ival = pval = 0 // error: cannot assign the value of a pointer to an int
string s1, s2;
s1 = s2 ="OK"; // ok: "OK"converted to string
3. 位运算优先级
移位操作符具有中等优先级:其优先级比算术操作符低,但比关系操作符、赋值操作符和条件操作符优先级高。若IO 表达式的操作数包含了比IO 操作符优先级低的操作符,相关的优先级别将影响书写该表达式的方式。通常需使用圆括号强制先实现右结合:
cout << 42 +10; // ok, + has higherprecedence, so the