@@ -14,7 +14,7 @@ The precedence of operators means we should compute some operators before
14
14
others even though the latter may show up first. For example: operator ` * `
15
15
has higher precedence than operator ` + ` , so that in expression ` 2 + 3 * 4 ` ,
16
16
the correct calculation result is ` 2 + (3 * 4) ` instead of ` (2 + 3) * 4 ` even
17
- though ` + ` comes before ` + ` .
17
+ though ` + ` comes before ` * ` .
18
18
19
19
C programming language had already defined the precedence for various
20
20
operators, you can refer to [ Operator
@@ -27,7 +27,7 @@ we'll get the result through the following steps:
27
27
1 . push ` 2 ` onto the stack.
28
28
2 . operator ` + ` is met, push it onto the stack, now we are expecting the other
29
29
argument for ` + ` .
30
- 3 . ` 3 ` is met, push it onto the stack. We are suppose to calculate ` 2+3 `
30
+ 3 . ` 3 ` is met, push it onto the stack. We are supposed to calculate ` 2+3 `
31
31
immediately, but we are not sure whether ` 3 ` belongs to the operator with
32
32
higher precedence, so leave it there.
33
33
4 . operator ` - ` is met. ` - ` has the same precedence as ` + ` , so we are sure
@@ -168,7 +168,7 @@ else if (token == Sizeof) {
168
168
}
169
169
```
170
170
171
- Note that only ` sizeof(int) ` , ` sizeof(char) ` and ` sizeof(pointer type ...) `
171
+ Note that only ` sizeof(int) ` , ` sizeof(char) ` (which by the way, is always ` 1 ` - by definition) and ` sizeof(pointer type ...) `
172
172
are supported, and the type of the result is ` int ` .
173
173
174
174
### Variable and function invocation
0 commit comments