Skip to content

Commit 30c6057

Browse files
committed
add lesson5
1 parent 97aa52e commit 30c6057

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

workspace/lesson5/operator.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package main
2+
3+
func main() {
4+
var a int = 10
5+
var b *int = &a
6+
println("a=",a, "address=", &a)
7+
println("b=", b, "*b=", *b)
8+
}

workspace/lesson5/readme.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# 运算符
2+
3+
* 算术运算符
4+
* 加+, 减-, 乘*,除 /, 模%, 自增++, 自减--
5+
* 关系运算符
6+
* 相等==
7+
* 不等!=
8+
* 大于>,大于等于>=
9+
* 小于<,小于等于<=
10+
* 逻辑运算符
11+
* 与&&
12+
* 或||
13+
* 非!
14+
* 位运算符
15+
* 位与&
16+
* 位或|
17+
* 亦或^
18+
* 左移<<
19+
* 右移>>
20+
* 赋值运算符
21+
* =, +=, -=, *=, /=, %=, <<=, >>=, &=, ^=, |=
22+
* 其它运算符
23+
* 返回变量的内存地址&
24+
* &a给出变量a的内存地址
25+
* 指针变量*
26+
* *a是一个指针变量

0 commit comments

Comments
 (0)