C언어 베이직 및 프로그램

c 언어 연산자 우선 순위

사라링 2015. 9. 8. 10:11

c 언어 코딩을 하면서 포인터 및 보안 관련 ( 악성코드 분석 등...) 하여 연산자 우선 순위는

말할수 없을 정도로 중요 하다. c 언어 기초 및 모든 개발언어 에 반드시 필요 함으로 

외워야 하며. 어설프게 알바에는 몰라서 찾아서 확인 해야 하는 부분 이니 반드시 외워 두자. !!!!!!!

  연산자 연산자 명 형 연산 방향**
1()   []   ->   .   ::

Grouping, scope, array/member access/

 primary  =======>
2 !   ~   -   +   *   &   sizeof   type cast ++x   --x  (most) unary operations, sizeof and type casts

 단항

 <=======
3*   /   %Multiplication, division, modulo 승법  =======>
4+   -Addition and subtraction 가법  =======>
5<<   >>Bitwise shift left and right 비트시프트  =======>
6<   <=   >   >=Comparisons: less-than, ...

 관계연산자

  =======>
7==   !=Comparisons: equal and not equal 등가  =======>
8&Bitwise AND 비트앤드  =======>
9^Bitwise exclusive OR 비트xor  =======>
10|Bitwise inclusive (normal) OR   =======>
11&&Logical AND

 논리곱

  =======>
12||Logical OR 논리합  =======>
13 ?:Conditional expression (ternary operator) 조건식  =======>
14=   +=   -=   *=   /=   %=   &=   |=   ^=   <<=   >>=Assignment operators

 대입

  <=======

15,Comma operator 쉼표연산자