Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update c.md #426

Merged
merged 1 commit into from
Sep 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions docs/c.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ int main() {
}
```

使用 `gcc` 编译 `hello.c` 文件
使用 `gcc` 编译 `hello.c` 源文件

```bash
$ gcc -o hello hello.c
```

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

```bash
$ ./hello
Expand All @@ -37,8 +37,8 @@ $ ./hello
```c
int myNum = 15;

int myNum2; // 不赋值,然后再赋值
myNum2 = 15;
int myNum2; // 声明变量 myNum2
myNum2 = 15; // 变量声明后第一次赋值我们称为初始化,如果 初始化 和 赋值 在同一行,那么我们可以直接称为 定义变量 myNum2

int myNum3 = 15; // myNum3 值为 15
myNum3 = 10; // 现在 myNum3 值为 10
Expand All @@ -54,6 +54,8 @@ int x = 5, y = 6, z = 50;
```

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

```c
const int minutesPerHour = 60;
Expand Down