“operator”:右移幅度过大,数据将丢失
右移操作幅度太大。 所有重要位都会移出,结果将始终为零。
示例
以下示例生成 C4333。
// C4333.cpp
// compile with: /c /W1
unsigned shift8 (unsigned char c) {
return c >> 8; // C4333
// try the following line instead
// return c >> 4; // OK
}
“operator”:右移幅度过大,数据将丢失
右移操作幅度太大。 所有重要位都会移出,结果将始终为零。
以下示例生成 C4333。
// C4333.cpp
// compile with: /c /W1
unsigned shift8 (unsigned char c) {
return c >> 8; // C4333
// try the following line instead
// return c >> 4; // OK
}