We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1496935 + b42f211 commit 0dd85deCopy full SHA for 0dd85de
docs/undef.md
@@ -255,17 +255,17 @@ bool 虽然占据 1 字节(8 位)内存空间,但其中只有一个有效
255
256
```cpp
257
char c = 0;
258
-bool b = *(bool *)c; // 可以,b = false
+bool b = *(bool *)&c; // 可以,b = false
259
```
260
261
262
char c = 1;
263
-bool b = *(bool *)c; // 可以,b = true
+bool b = *(bool *)&c; // 可以,b = true
264
265
266
267
char c = 2;
268
-bool b = *(bool *)c; // 未定义行为
+bool b = *(bool *)&c; // 未定义行为
269
270
271
## 算数类
0 commit comments