-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
363 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
##### 一元运算符 | ||
- 一元运算符 | ||
- 一元运算符出现在其操作数前, 并按照从右到左的顺序关联 | ||
- 语法 | ||
```c | ||
++ unary-expression | ||
// 前缀自增 | ||
// ++a 存储 a+1 到 a, 返回 a+1 | ||
|
||
-- unary-expression | ||
// 前缀自减 | ||
// --a 存储 a-1 到 a, 返回 a-1 | ||
|
||
& | ||
// 取址 | ||
// &a 创建指向对象或函数 a 的指针 | ||
|
||
* | ||
// 指针解引用 | ||
// *a 解引用指针 a 以访问其所指向的对象或函数 | ||
|
||
+ | ||
// 一元加 | ||
// +a a 提升后的值 | ||
|
||
- | ||
// 算术求反 | ||
// -a a 的相反数 | ||
|
||
~ | ||
// 按位非 | ||
// ~a a 的按位非 | ||
|
||
! | ||
// 逻辑非 | ||
// !a a 的逻辑非 | ||
|
||
sizeof unary-expression | ||
sizeof ( type-name ) | ||
// sizeof 运算符 | ||
// sizeof a a 的字节大小 | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
##### 乘法运算符 | ||
- 乘法运算符 | ||
- 乘法运算符执行乘法, 除法和余数运算 | ||
- 语法 | ||
```c | ||
* | ||
// 乘法 | ||
// a * b a 和 b 的积 | ||
|
||
/ | ||
// 除法 | ||
// a / b a 除以 b 的商 | ||
|
||
% | ||
// 余数 | ||
// a % b a 除以 b 的余数 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
##### 关系和相等运算符 | ||
- 关系和相等运算符 | ||
- 二元关系运算符和相等运算符将其第一个操作数与其第二个操作数进行比较以测试指定关系的有效性. 如果测试的关系为 true, 则关系表达式的结果为 1, 如果测试的关系为 false, 则关系表达式的结果为 0. 结果的类型为 int | ||
- 语法 | ||
```c | ||
< | ||
// 小于 | ||
// a < b a 小于 b | ||
|
||
> | ||
// 大于 | ||
// a > b a 大于 b | ||
|
||
<= | ||
// 小于或等于 | ||
// a <= b a 小于或等于 b | ||
|
||
>= | ||
// 大于或等于 | ||
// a >= b a 大于或等于 b | ||
|
||
== | ||
// 等于 | ||
// a == b a 等于 b | ||
|
||
!= | ||
// 不等于 | ||
// a != b a 不等于b | ||
|
||
|
||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
##### 加法运算符 | ||
- 加法运算符 | ||
- 加法运算符执行加法和减法运算 | ||
- 语法 | ||
```c | ||
+ | ||
// 加法 | ||
// a + b a 加 b | ||
|
||
- | ||
// 减法 | ||
// a - b 从 a 减去 b | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
##### 后缀运算符 | ||
- 后缀运算符 | ||
- 后缀运算符为数组下标, 函数调用, 结构和联合成员以及后缀递增和递减运算符. 后缀运算符在表达式计算中具有最高优先级 | ||
- 语法 | ||
```c | ||
postfix-expression [ expression ] | ||
// 数组下标 | ||
// a[b] 访问数组 a 的第 b 个元素 | ||
|
||
postfix-expression ( argument-expression-listopt ) | ||
// 函数调用 | ||
// f(...) 以零或更多实参调用 f() | ||
|
||
postfix-expression . identifier | ||
postfix-expression -> identifier | ||
// 结构和联合成员 | ||
// a.b 访问结构体或联合体 a 的成员 b | ||
// a->b 访问 a 所指向的结构体或联合体的成员 b | ||
|
||
postfix-expression ++ | ||
// 后缀自增 | ||
// a++ 存储 a+1 到 a, 返回 a 的旧值 | ||
|
||
postfix-expression -- | ||
// 后缀自减 | ||
// a-- 存储 a-1 到 a, 返回 a 的旧值 | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
##### 强制转换运算符 | ||
- 强制转换运算符 | ||
- 在特定情况下, 类型强制转换提供了用于显式转换对象类型的方法 | ||
- 语法 | ||
```c | ||
( type-name ) cast-expression | ||
// 强制转换 | ||
// (type)a 转型 a 的类型为 type | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
##### 按位移位运算符 | ||
- 按位移位运算符 | ||
- 移位运算符按第二个操作数指定的位置数量向左或向右移动第一个操作数 | ||
- 语法 | ||
```c | ||
<< | ||
// 按位左移 | ||
// a << b a 左移 b 位 | ||
|
||
>> | ||
// 按位右移 | ||
// a >> b a 右移 b 位 | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
##### 按位运算符 | ||
- 按位运算符 | ||
- 按位运算符执行按位与, 按位或, 按位异或运算 | ||
- 语法 | ||
```c | ||
& | ||
// 按位与 | ||
// a & b a 和 b 的按位与 | ||
|
||
| | ||
// 按位或 | ||
// a | b a 和 b 的按位或 | ||
|
||
^ | ||
// 按位异或 | ||
// a ^ b a 和 b 的按位异或 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
##### 操作数 | ||
- 操作数 | ||
- 操作数是[[C.表达式|表达式]]的[[C.运算符|运算符]]作用于的实体, 还有表达式本身也可作为操作数, 包括[[C.常量|常量]], [[C.标识符|标识符]], 函数调用表达式, 下标表达式, 成员选择表达式以及通过将操作数与运算符组合或将操作数括在括号中而形成的复杂表达式 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
##### 条件表达式运算符 | ||
- 条件表达式运算符 | ||
- 条件表达式运算符是三元运算符, 按条件计算表达式 | ||
- 语法 | ||
```c | ||
logical-OR-expression ? expression : conditional-expression | ||
// 条件运算符 | ||
// a ? b : c 若 a 逻辑上为真, 则求值表达式 b, 否则求值表达式 c | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
##### 表达式 | ||
- 表达式 | ||
- **表达式**是一种公式, 通过使用[[C.运算符|运算符]]将操作数相互连接起来以计算值, 当然如果操作数本身表示一个值也可以不需要运算符. **操作数**是运算符作用于的实体, 包括[[C.常量|常量]], [[C.标识符|标识符]], 字符串, 函数调用, 下标表达式, 成员选择表达式以及通过将操作数与运算符组合或将操作数括在括号中而形成的复杂表达式 | ||
- 每个表达式都具有两个独立的属性: [[C.数据类型|数据类型]]和[[C.值类别|值类别]] | ||
- **表达式**是一种公式, 通过使用[[C.运算符|运算符]]将[[C.操作数|操作数]]相互连接起来以计算值, 当然如果操作数本身表示一个值也可以不需要运算符. 每个表达式都具有两个独立的属性: [[C.数据类型|数据类型]]和[[C.值类别|值类别]] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
##### 赋值运算符 | ||
- 赋值运算符 | ||
- 赋值操作将右侧操作数的值分配给左侧操作数命名的存储位置. 因此, 赋值操作的左侧操作数必须是一个可修改的左值. 在赋值后, 赋值表达式具有左操作数的值, 但不是左值. 简单赋值及复合赋值运算符是二元运算符, 它们用其右侧的值修改其左侧的变量 | ||
- 语法 | ||
```c | ||
= | ||
// 基本赋值 | ||
// a = b a 变得等于 b | ||
|
||
+= | ||
// 加法赋值 | ||
// a = a + b | ||
// a += b a 变得等于 a 与 b 的和 | ||
|
||
-= | ||
// 减法赋值 | ||
// a = a - b | ||
// a -= b a 变得等于 a 减 b 的差 | ||
|
||
*= | ||
// 乘法赋值 | ||
// a = a * b | ||
// a *= b a 变得等于 a 与 b 的积 | ||
|
||
/= | ||
// 除法赋值 | ||
// a = a / b | ||
// a /= b a 变得等于 a 除以 b的商 | ||
|
||
%= | ||
// 模赋值 | ||
// a = a % b | ||
// a %= b a 变得等于 a 除以 b 的余数 | ||
|
||
&= | ||
// 逐位与赋值 | ||
// a = a & b | ||
// a &= b a 变得等于 a 与 b 的逐位与 | ||
|
||
|= | ||
// 逐位或赋值 | ||
// a = a | b | ||
// a |= b a 被替换为 a 与 b 的逐位或 | ||
|
||
^= | ||
// 逐位异或赋值 | ||
// a = a ^ b | ||
// a ^= b a 被替换为 a 与 b 的逐位异或 | ||
|
||
<<= | ||
// 逐位左移赋值 | ||
// a = a << b | ||
// a <<= b a 被替换为 a 左移 b 位 | ||
|
||
>>= | ||
// 逐位右移赋值 | ||
// a = a >> b | ||
// a >>= b a 被替换为 a 右移 b 位 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
##### 运算符 | ||
- 运算符 | ||
- 赋值运算符 | ||
- 后缀运算符 | ||
- 一元运算符 | ||
- 强制转换运算符 | ||
- 乘法运算符 | ||
- 加法运算符 | ||
- 按位移位运算符 | ||
- 关系和相等运算符 | ||
- 按位运算符 | ||
- 逻辑运算符 | ||
- 条件表达式运算符 | ||
- 顺序计算运算符 | ||
- 运算符是[[C.表达式|表达式]]中执行特定操作的符号, 运算符优先级定义运算符绑定到其实参的顺序, 代用表示是一些运算符的代用写法 | ||
- 语法 | ||
|
||
| 优先级 | 运算符 | 描述 | 结合性 | | ||
| --- | ---------------------------------------------------------- | ---------------------------- | ------- | | ||
| 1 | `++` `--` `()` `[]`<br>`.` `->` | [[C.后缀运算符]] | 从左到右 -> | | ||
| 2 | `++` `--` `+` `-` `!` <br>`~` `*` `&` `sizeof`<br>`(type)` | [[C.一元运算符]]<br>[[C.强制转换运算符]] | 从右到左 <- | | ||
| 3 | `*` `/` `%` | [[C.乘法运算符]] | 从左到右 -> | | ||
| 4 | `+` `-` | [[C.加法运算符]] | 从左到右 -> | | ||
| 5 | `<<` `>>` | [[C.按位移位运算符]] | 从左到右 -> | | ||
| 6 | `<` `<=` `>` `>=` | [[C.关系和相等运算符\|C.关系运算符]] | 从左到右 -> | | ||
| 7 | `==` `!=` | [[C.关系和相等运算符\|C.相等运算符]] | 从左到右 -> | | ||
| 8 | `&` | [[C.按位运算符]] 按位与 | 从左到右 -> | | ||
| 9 | `^` | [[C.按位运算符]] 按位异或 | 从左到右 -> | | ||
| 10 | `\|` | [[C.按位运算符]] 按位或 | 从左到右 -> | | ||
| 11 | `&&` | [[C.逻辑运算符]] 逻辑与 | 从左到右 -> | | ||
| 12 | `\|\|` | [[C.逻辑运算符]] 逻辑或 | 从左到右 -> | | ||
| 13 | `?:` | [[C.条件表达式运算符]] | 从右到左 <- | | ||
| 14 | `=` | [[C.赋值运算符]] | 从右到左 <- | | ||
| 15 | `,` | [[C.顺序计算运算符]] | 从左到右 -> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
##### 逻辑运算符 | ||
- 逻辑运算符 | ||
- 逻辑运算符对其操作数应用标准布尔代数运算 | ||
- 语法 | ||
```c | ||
&& | ||
// 逻辑与 | ||
// a && b a 与 b 的逻辑与 | ||
|
||
|| | ||
// 逻辑或 | ||
// a || b a 与 b 的逻辑或 | ||
|
||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
##### 顺序计算运算符 | ||
- 顺序计算运算符 | ||
- 顺序计算运算符, 也称为逗号运算符, 按从左到右的顺序计算其两个操作数 | ||
- 语法 | ||
```c | ||
, | ||
// 逗号运算符 | ||
// a, b 求值表达式 a, 舍弃其返回值并完成任何副效应, 然后求值表达式 b, 返回此求值的类型和结果 | ||
``` |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
##### 介值定理 | ||
- 介值定理 | ||
- 若函数 $f$ 在 $[a,b]$ 上连续, 且 $f(a)<0$, $f(b)>0$, 则区间 $(a,b)$ 上至少有一点 $c$ 使得 $f(c)=0$ | ||
- 对于零值, 若函数 $f$ 在 $[a,b]$ 上连续, 且 $f(a)<0$, $f(b)>0$, 则区间 $(a,b)$ 上至少有一点 $c$ 使得 $f(c)=0$ | ||
- 一般地, 若函数 $f$ 在 $[a,b]$ 上连续, 且 $f(a)\neq f(b)$, 那么对于任意介于 $f(a)$ 和 $f(b)$ 之间的值 $L$, 存在 $c \in (a, b)$, 使得 $f(c) = L$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.