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

来源:互联网 发布:python 基础教程 pdf 编辑:程序博客网 时间:2024/05/20 07:52


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-right4+ −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-Left14=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

0 0
原创粉丝点击