From dfc164bd96476b99707807f555c482bf4c8637e5 Mon Sep 17 00:00:00 2001 From: jaywcjlove Date: Sun, 10 Sep 2023 07:34:16 +0000 Subject: [PATCH] doc: Update c.md (#426) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改了初始化,声明和定义的区别注释 b3cf04d3237bd9151ca106e84822eeea4e7ca625 --- CONTRIBUTORS.svg | 106 ++++++++++++++++++++++++----------------------- docs/c.html | 10 +++-- index.html | 6 +-- 3 files changed, 63 insertions(+), 59 deletions(-) diff --git a/CONTRIBUTORS.svg b/CONTRIBUTORS.svg index 024725df..0b523672 100644 --- a/CONTRIBUTORS.svg +++ b/CONTRIBUTORS.svg @@ -120,109 +120,111 @@ + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + \ No newline at end of file diff --git a/docs/c.html b/docs/c.html index 0ca62a64..6db9337b 100644 --- a/docs/c.html +++ b/docs/c.html @@ -42,10 +42,10 @@ return 0; } -

使用 gcc 编译 hello.c 文件

+

使用 gcc 编译 hello.c 源文件

$ gcc -o hello hello.c
 
-

运行编译后的二进制文件(hello)

+

运行编译后的二进制文件可执行文件(hello)

$ ./hello
 # 输出 => Hello World
 
@@ -53,8 +53,8 @@
int myNum = 15;
 
-int myNum2; // 不赋值,然后再赋值
-myNum2 = 15;
+int myNum2; // 声明变量 myNum2
+myNum2 = 15; // 变量声明后第一次赋值我们称为初始化,如果 初始化 和 赋值 在同一行,那么我们可以直接称为 定义变量 myNum2
 
 int myNum3 = 15;  // myNum3 值为 15
 myNum3 = 10;      // 现在 myNum3 值为 10
@@ -69,6 +69,8 @@
 int x = 5, y = 6, z = 50;
 

常量 Constants

+

注释 +常量在 C 语言中我们一般理解为不能被改变的值,活用常量与符号常量

const int minutesPerHour = 60;
 const float PI = 3.14;
 
diff --git a/index.html b/index.html index 8b687d79..7ec59fea 100644 --- a/index.html +++ b/index.html @@ -890,8 +890,8 @@ 老大哥 - - Maylon + + Xu Guotao 花殇 @@ -1359,7 +1359,7 @@

如果你有资源,可以很方便部署 web 版,这非常简单,只需要克隆 gh-pages 分支代码到你的静态服务就可以了,还可以使用 docker 快捷部署 web 版。

-
+