經過我不懈的努力我終于弄清楚了sizeof到底是何方聖神: 現在我要明确的告訴大家sizeof既是關鍵字又是運算符。
在c99标準中明确提到保留下來的關鍵有32個:
(6.4.1) keyword: one of
auto break case char const continue default do
double else enum extern float for goto if
int long register return short signed sizeof
struct switch typedef union unsigned void volatile while
在C語言中的運算符号
() [ ] -> . ! ++ -- | 圓括号、方括号、指針、成員、邏輯非、自加、自減 |
++ 、 -- 、 * 、 & 、 ~ 、 ! 、 + 、 - 、 sizeof、(cast) | 單目運算符 |
* 、 / 、 % | 算術運算符 |
+ 、 - | 算術運算符 |
<< 、 >> | 位運算符 |
< 、 <= 、 > 、 >= | 關系運算符 |
== 、 != | 關系運算符号 |
& | 位與 |
^ | 位異或 |
| | 位或 |
&& | 邏輯與 |
|| | 邏輯或 |
? 、 : | 條件運算符 |
= 、 += 、 -= 、 *= 、 /= 、 %= 、 &= 、 |= 、 ^= | |