diff --git a/docs/notes/01_c-basic/03_xdx/assets/15.png b/docs/notes/01_c-basic/03_xdx/assets/15.png
deleted file mode 100644
index b4bb077..0000000
Binary files a/docs/notes/01_c-basic/03_xdx/assets/15.png and /dev/null differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/15.svg b/docs/notes/01_c-basic/03_xdx/assets/15.svg
new file mode 100644
index 0000000..bec2286
--- /dev/null
+++ b/docs/notes/01_c-basic/03_xdx/assets/15.svg
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/docs/notes/01_c-basic/03_xdx/assets/16.png b/docs/notes/01_c-basic/03_xdx/assets/16.png
deleted file mode 100644
index b67e43c..0000000
Binary files a/docs/notes/01_c-basic/03_xdx/assets/16.png and /dev/null differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/16.svg b/docs/notes/01_c-basic/03_xdx/assets/16.svg
new file mode 100644
index 0000000..9069c99
--- /dev/null
+++ b/docs/notes/01_c-basic/03_xdx/assets/16.svg
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/docs/notes/01_c-basic/03_xdx/assets/17.png b/docs/notes/01_c-basic/03_xdx/assets/17.png
deleted file mode 100644
index d395e88..0000000
Binary files a/docs/notes/01_c-basic/03_xdx/assets/17.png and /dev/null differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/17.svg b/docs/notes/01_c-basic/03_xdx/assets/17.svg
new file mode 100644
index 0000000..fc887e8
--- /dev/null
+++ b/docs/notes/01_c-basic/03_xdx/assets/17.svg
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/docs/notes/01_c-basic/03_xdx/assets/18.png b/docs/notes/01_c-basic/03_xdx/assets/18.png
index 492533f..b4bb077 100644
Binary files a/docs/notes/01_c-basic/03_xdx/assets/18.png and b/docs/notes/01_c-basic/03_xdx/assets/18.png differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/19.png b/docs/notes/01_c-basic/03_xdx/assets/19.png
index 98ec4d7..b67e43c 100644
Binary files a/docs/notes/01_c-basic/03_xdx/assets/19.png and b/docs/notes/01_c-basic/03_xdx/assets/19.png differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/20.png b/docs/notes/01_c-basic/03_xdx/assets/20.png
index 3b96ef9..d395e88 100644
Binary files a/docs/notes/01_c-basic/03_xdx/assets/20.png and b/docs/notes/01_c-basic/03_xdx/assets/20.png differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/21.png b/docs/notes/01_c-basic/03_xdx/assets/21.png
index 1395b61..492533f 100644
Binary files a/docs/notes/01_c-basic/03_xdx/assets/21.png and b/docs/notes/01_c-basic/03_xdx/assets/21.png differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/22.png b/docs/notes/01_c-basic/03_xdx/assets/22.png
index ab725ed..98ec4d7 100644
Binary files a/docs/notes/01_c-basic/03_xdx/assets/22.png and b/docs/notes/01_c-basic/03_xdx/assets/22.png differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/23.png b/docs/notes/01_c-basic/03_xdx/assets/23.png
index 28952c7..3b96ef9 100644
Binary files a/docs/notes/01_c-basic/03_xdx/assets/23.png and b/docs/notes/01_c-basic/03_xdx/assets/23.png differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/24.png b/docs/notes/01_c-basic/03_xdx/assets/24.png
index 01cbb98..1395b61 100644
Binary files a/docs/notes/01_c-basic/03_xdx/assets/24.png and b/docs/notes/01_c-basic/03_xdx/assets/24.png differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/25.png b/docs/notes/01_c-basic/03_xdx/assets/25.png
index 8fd18c6..ab725ed 100644
Binary files a/docs/notes/01_c-basic/03_xdx/assets/25.png and b/docs/notes/01_c-basic/03_xdx/assets/25.png differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/26.png b/docs/notes/01_c-basic/03_xdx/assets/26.png
index da4651f..28952c7 100644
Binary files a/docs/notes/01_c-basic/03_xdx/assets/26.png and b/docs/notes/01_c-basic/03_xdx/assets/26.png differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/27.png b/docs/notes/01_c-basic/03_xdx/assets/27.png
index 159309c..01cbb98 100644
Binary files a/docs/notes/01_c-basic/03_xdx/assets/27.png and b/docs/notes/01_c-basic/03_xdx/assets/27.png differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/28.png b/docs/notes/01_c-basic/03_xdx/assets/28.png
index 03d6d61..8fd18c6 100644
Binary files a/docs/notes/01_c-basic/03_xdx/assets/28.png and b/docs/notes/01_c-basic/03_xdx/assets/28.png differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/29.png b/docs/notes/01_c-basic/03_xdx/assets/29.png
index 097d775..da4651f 100644
Binary files a/docs/notes/01_c-basic/03_xdx/assets/29.png and b/docs/notes/01_c-basic/03_xdx/assets/29.png differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/30.gif b/docs/notes/01_c-basic/03_xdx/assets/30.gif
deleted file mode 100644
index c69607b..0000000
Binary files a/docs/notes/01_c-basic/03_xdx/assets/30.gif and /dev/null differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/30.png b/docs/notes/01_c-basic/03_xdx/assets/30.png
new file mode 100644
index 0000000..159309c
Binary files /dev/null and b/docs/notes/01_c-basic/03_xdx/assets/30.png differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/31.png b/docs/notes/01_c-basic/03_xdx/assets/31.png
index ebf9def..03d6d61 100644
Binary files a/docs/notes/01_c-basic/03_xdx/assets/31.png and b/docs/notes/01_c-basic/03_xdx/assets/31.png differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/32.gif b/docs/notes/01_c-basic/03_xdx/assets/32.gif
deleted file mode 100644
index 44bc138..0000000
Binary files a/docs/notes/01_c-basic/03_xdx/assets/32.gif and /dev/null differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/32.png b/docs/notes/01_c-basic/03_xdx/assets/32.png
new file mode 100644
index 0000000..097d775
Binary files /dev/null and b/docs/notes/01_c-basic/03_xdx/assets/32.png differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/33.gif b/docs/notes/01_c-basic/03_xdx/assets/33.gif
index 271960b..c69607b 100644
Binary files a/docs/notes/01_c-basic/03_xdx/assets/33.gif and b/docs/notes/01_c-basic/03_xdx/assets/33.gif differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/34.png b/docs/notes/01_c-basic/03_xdx/assets/34.png
index 597db56..ebf9def 100644
Binary files a/docs/notes/01_c-basic/03_xdx/assets/34.png and b/docs/notes/01_c-basic/03_xdx/assets/34.png differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/35.gif b/docs/notes/01_c-basic/03_xdx/assets/35.gif
index 271960b..44bc138 100644
Binary files a/docs/notes/01_c-basic/03_xdx/assets/35.gif and b/docs/notes/01_c-basic/03_xdx/assets/35.gif differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/36.gif b/docs/notes/01_c-basic/03_xdx/assets/36.gif
index b7b5a3a..271960b 100644
Binary files a/docs/notes/01_c-basic/03_xdx/assets/36.gif and b/docs/notes/01_c-basic/03_xdx/assets/36.gif differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/37.png b/docs/notes/01_c-basic/03_xdx/assets/37.png
new file mode 100644
index 0000000..597db56
Binary files /dev/null and b/docs/notes/01_c-basic/03_xdx/assets/37.png differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/38.gif b/docs/notes/01_c-basic/03_xdx/assets/38.gif
new file mode 100644
index 0000000..271960b
Binary files /dev/null and b/docs/notes/01_c-basic/03_xdx/assets/38.gif differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/39.gif b/docs/notes/01_c-basic/03_xdx/assets/39.gif
new file mode 100644
index 0000000..b7b5a3a
Binary files /dev/null and b/docs/notes/01_c-basic/03_xdx/assets/39.gif differ
diff --git a/docs/notes/01_c-basic/03_xdx/assets/37.gif b/docs/notes/01_c-basic/03_xdx/assets/40.gif
similarity index 100%
rename from docs/notes/01_c-basic/03_xdx/assets/37.gif
rename to docs/notes/01_c-basic/03_xdx/assets/40.gif
diff --git a/docs/notes/01_c-basic/03_xdx/assets/38.png b/docs/notes/01_c-basic/03_xdx/assets/41.png
similarity index 100%
rename from docs/notes/01_c-basic/03_xdx/assets/38.png
rename to docs/notes/01_c-basic/03_xdx/assets/41.png
diff --git a/docs/notes/01_c-basic/03_xdx/index.md b/docs/notes/01_c-basic/03_xdx/index.md
index 4049772..41f6996 100644
--- a/docs/notes/01_c-basic/03_xdx/index.md
+++ b/docs/notes/01_c-basic/03_xdx/index.md
@@ -1310,6 +1310,60 @@ int main(){
}
```
+## 1.7 再谈数据类型
+
+* 通过之前的知识,我们知道,CPU 是直接和内存打交道的,CPU 在处理数据的时候,会将数据临时存放到内存中。内存那么大,CPU 是怎么找到对应的数据的?
+
+* 首先,CPU 会将内存按照字节(1 Bytes = 8 bit,我们也称为存储单元)进行划分,如下所示:
+
+> [!NOTE]
+>
+> 这些存储单元中,存储的都是 0 和 1 这样的数据,因为计算机只能识别二进制数。
+
+![](./assets/15.svg)
+
+* 并且,为了方便管理,每个独立的小单元格,即:存储单元,都有自己唯一的编号(内存地址),如下所示:
+
+> [!NOTE]
+>
+> 之所以,要给每个存储单元加上内存地址,就是为了`加快`数据的`存取速度`,可以类比生活中的`字典`以及`快递单号`。
+
+![](./assets/16.svg)
+
+* 我们在定义变量的时候,是这么定义的,如下所示:
+
+```c
+int num = 10;
+```
+
+> [!NOTE]
+>
+> 上述的代码其实透露了三个重要的信息:
+>
+> * ① 数据存储在哪里。
+> * ② 数据的长度是多少。
+> * ③ 数据的处理方式。
+
+* 其实,在编译器对程序进行编译的时候,是这样做的,如下所示:
+
+> [!NOTE]
+>
+> * ① 编译器在编译的时候,就将变量替换为内存中存储单元的内存地址(知道了你家的门牌号),这样就可以方便的进行存取数据了(解答了上述的问题 ① )。
+> * ② 变量中其实存储的是初始化值 10 在内存中存储单元的首地址,我们也知道,数据类型 int 的存储空间是 4 个字节,那么根据首地址 + 4 个字节就可以完整的将数据从内存空间中完整地取出来或存储进去(解答了上述的问题 ② )。
+> * ③ 我们知道,数据在计算机底层的存储方式是不一样的,如:整数在计算机底层的存储就是计算机补码的方式,浮点数在计算机底层的存储类似于科学计数法;但是,字符类型在计算机底层的存储和整数和浮点数完全不同,需要查码表:在存储的时候,需要先查询码表,然后在转换为二进制进行存储;在读取的时候,也需要先查询码表,将二进制转换为对应的字符(解答了上述的问题 ③ )。
+
+> [!CAUTION]
+>
+> * ① 数据类型只在定义变量的时候声明,而且必须声明;在使用变量的时候,就无需再声明,因为此时的数据类型已经确定的。
+> * ② 在实际开发中,我们通常将普通变量等价于内存中某个区域的值(底层到底是怎么转换的,那是编译器帮我们完成的,我们通常无需关心,也没必要关心)。
+> * ③ 某些动态的编程语言,如:JavaScript ,在定义变量的时候,是不需要给出数据类型的,编译器会根据赋值情况自动推断出变量的数据类型,貌似很智能;但是,这无疑增加了编译器的工作,降低了程序的性能(动态一时爽,重构火葬场,说的就是动态编程语言,不适合大型项目的开发;所以,之后微软推出了 TypeScript ,就是为了在给 JavaScript 增加强类型系统,以提高开发和运行效率)。
+
+![](./assets/17.svg)
+
+
+
+
+
# 第二章:运算符(⭐)
@@ -1319,11 +1373,11 @@ int main(){
* 运算符是一种特殊的符号,用于数据的运算、赋值和比较等。
* `表达式`指的是一组运算数、运算符的组合,表达式`一定具有值`,一个变量或一个常量可以是表达式,变量、常量和运算符也可以组成表达式,如:
-![](./assets/15.png)
+![](./assets/18.png)
* `操作数`指的是`参与运算`的`值`或者`对象`,如:
-![](./assets/16.png)
+![](./assets/19.png)
* 根据`操作数`的`个数`,可以将运算符分为:
* 一元运算符(一目运算符)。
@@ -1785,13 +1839,13 @@ int main() {
* 示例:`9 & 7 = 1`
-![](./assets/17.png)
+![](./assets/20.png)
* 示例:`-9 & 7 = 7`
-![](./assets/18.png)
+![](./assets/21.png)
### 2.6.4 按位或
@@ -1805,13 +1859,13 @@ int main() {
* 示例:`9 | 7 = 15`
-![](./assets/19.png)
+![](./assets/22.png)
* 示例:`-9 | 7 = -9`
-![](./assets/20.png)
+![](./assets/23.png)
### 2.6.5 按位异或
@@ -1834,13 +1888,13 @@ int main() {
* 示例:`9 ^ 7 = 14`
-![](./assets/21.png)
+![](./assets/24.png)
* 示例:`-9 ^ 7 = -16`
-![](./assets/22.png)
+![](./assets/25.png)
### 2.6.6 按位取反
@@ -1852,13 +1906,13 @@ int main() {
* 示例:`~9 = -10`
-![](./assets/23.png)
+![](./assets/26.png)
* 示例:`~-9 = 8`
-![](./assets/24.png)
+![](./assets/27.png)
### 2.6.7 二进制左移
@@ -1868,13 +1922,13 @@ int main() {
* 示例:`3 << 4 = 48` (3 × 2^4)
- ![](./assets/25.png)
+ ![](./assets/28.png)
* 示例:`-3 << 4 = -48` (-3 × 2 ^4)
-![](./assets/26.png)
+![](./assets/29.png)
### 2.6.8 二进制右移
@@ -1889,13 +1943,13 @@ int main() {
* 示例:`69 >> 4 = 4` (69 ÷ 2^4 )
-![](./assets/27.png)
+![](./assets/30.png)
* 示例:`-69 >> 4 = -5` (-69 ÷ 2^4 )
-![](./assets/28.png)
+![](./assets/31.png)
## 2.7 三元运算符
@@ -2008,17 +2062,17 @@ int main() {
* `字符集`和`字符集编码`之间的关系如下:
-![](./assets/29.png)
+![](./assets/32.png)
* Linux 中安装帮助手册:
-![](./assets/30.gif)
+![](./assets/33.gif)
### 3.3.2 ASCII 编码
* 从`冯·诺依曼`体系结构中,我们知道,计算机中所有的`数据`和`指令`都是以`二进制`的形式表示的;所以,计算机中对于文本数据的数据也是以二进制来存储的,那么对应的流程如下:
-![](./assets/31.png)
+![](./assets/34.png)
* 我们知道,计算机是上个世纪 60 年代在美国研制成功的,为了实现字符和二进制的转换,美国就制定了一套字符编码,即英语字符和二进制位之间的关系,即 ASCII (American Standard Code for Information Interchange)编码:
- ASCII 编码只包括了英文字符、数字和一些特殊字符,一共 128 个字符,并且每个字符都分配了唯一的数字,范围是 0 - 127。
@@ -2035,24 +2089,24 @@ int main() {
man ascii
```
-![](./assets/32.gif)
+![](./assets/35.gif)
* 其对应的 ASCII 编码表,如下所示:
-![](./assets/33.gif)
+![](./assets/36.gif)
* 但是,随着计算机的发展,计算机开始了东征之路,由美国传播到东方:
-![](./assets/34.png)
+![](./assets/37.png)
- 先是传播到了欧洲,欧洲在兼容 ASCII 编码的基础上,推出了 ISO8859-1 编码,即:
- ISO8859-1 编码包括基本的拉丁字母表、数字、标点符号,以及西欧语言中特有的一些字符,如:法语中的 `è`、德语中的 `ü` 等。
- ISO 8859-1 为每个字符分配一个单字节(8 位)编码,意味着它可以表示最多 256 (2^8)个不同的字符(编号从 0 到 255)。
- ISO 8859-1 的前 128 个字符与 ASCII 编码完全一致,这使得 ASCII 编码的文本可以无缝转换为 ISO 8859-1 编码。
-![](./assets/35.gif)
+![](./assets/38.gif)
-![](./assets/36.gif)
+![](./assets/39.gif)
- 计算机继续传播到了亚洲,亚洲(双字节)各个国家分别给出了自己国家对应的字符集编码,如:
- 日本推出了 Shift-JIS 编码:
@@ -2085,7 +2139,7 @@ man ascii
- Unicode 仅仅只是字符集,给每个字符设置了唯一的数字编号而已,却没有给出这些数字编号实际如何存储,可以通过如下命令查看:
-![](./assets/37.gif)
+![](./assets/40.gif)
- 为了在计算机系统中表示 Unicode 字符,定义了几种编码方案,这些方案包括 UTF-8、UTF-16 和 UTF-32 等。
- **UTF-8**:使用 1 - 4 个字节表示每个 Unicode 字符,兼容 ASCII,是网络上最常用的编码。
@@ -2093,4 +2147,4 @@ man ascii
- **UTF-32**:使用固定的 4 个字节表示每个 Unicode 字符,简化了字符处理,但增加了存储空间的需求。
- `Unicode 字符集`和对应的`UTF-8 字符编码`之间的关系,如下所示:
-![](./assets/38.png)
+![](./assets/41.png)