Skip to content

Commit

Permalink
Merge pull request #49 from YangZ2020/main
Browse files Browse the repository at this point in the history
Update undef.md 中解引用笔误
  • Loading branch information
archibate authored Oct 9, 2024
2 parents 1496935 + b42f211 commit 0dd85de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/undef.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,17 @@ bool 虽然占据 1 字节(8 位)内存空间,但其中只有一个有效

```cpp
char c = 0;
bool b = *(bool *)c; // 可以,b = false
bool b = *(bool *)&c; // 可以,b = false
```

```cpp
char c = 1;
bool b = *(bool *)c; // 可以,b = true
bool b = *(bool *)&c; // 可以,b = true
```

```cpp
char c = 2;
bool b = *(bool *)c; // 未定义行为
bool b = *(bool *)&c; // 未定义行为
```

## 算数类
Expand Down

0 comments on commit 0dd85de

Please sign in to comment.