运算符优先级-C语言运算符优先级


C语言运算符优先级
优先级运算符描述方向
1++ --Suffix/postfix increment and decrement-前缀/后缀递增和递减Left-to-right
()Function call-函数调用
[]Array subscripting-数组下标
.Structure and union member access-结构和联盟成员的访问
−>Structure and union member access through pointer-结构和联盟成员通过指针访问
(type){list}Compound literal(C99)-复合文字(C99)
2++ --Prefix increment and decrement-前缀递增和递减Right-to-left
+ −Unary plus and minus-+和-
! ~Logical NOT and bitwise NOT-逻辑不是和逐位
(type)Type cast-类型转换
*Indirection (dereference)-间接(废弃)
&Address-of-取地址
sizeofSize-of-占用字符
_AlignofAlignment requirement(C11)-对齐需求(C11)
3* / %Multiplication, division, and remainder-乘、除、余Left-to-right
4+ −Addition and subtraction-加法和减法
5<< >>Bitwise left shift and right shift-位左移和右移
6< <=For relational operators < and ≤ respectively-关系运算符
> >=For relational operators > and ≥ respectively-关系运算符
7== !=For relational = and ≠ respectively-关系运算符
8&Bitwise AND-位和
9^Bitwise XOR (exclusive or)-位XOR(异或)
10|Bitwise OR (inclusive or)-按位或(包括)
11&&Logical AND-逻辑和
12||Logical OR-逻辑或
13?:Ternary conditional-三元运算符Right-to-Left
14=Simple assignment-赋值
+= −=Assignment by sum and difference-赋值运算符
*= /= %=Assignment by product, quotient, and remainder-赋值运算符
<<= >>=Assignment by bitwise left shift and right shift-赋值运算符
&= ^= |=Assignment by bitwise AND, XOR, and OR-赋值运算符
15,CommaLeft-to-right

  • 2
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值