- Precedence : Operator precedence describes the order in which C reads expressions
- Associativity : Order operators of equal precedence in an expression are applied
Operator | Precedence | Associative |
(),[] | 1 | Left to Right |
*,Identifier | 2 | Right to Left |
Data Type | 3 | - |
Different Terms From Table -
() | Bracket operator OR function operator. |
[] | Array subscription operator |
* | Pointer operator |
Identifier | Name of Pointer Variable |
Data type | Type of Pointer |
How to Read ?
char (* ptr)[5]
Step 1 :
- Observe Above Precedence Table
- [] and () have Same Priority
- Using Associativity , Highest Priority Element is decided
- Associativity is from Left to Right First Priority is Given to "()"
- Between Pair of Brackets again we have to decide which one has highest priority ? '*' or 'ptr' ?
- * and Identifier ptr have Same Priority
- Associativity is from Right to Left First Priority is Given to "ptr"
- Assign third Priority to [].
- Write 3 under []
- Here Char is Data Type
- Assign Priority 4 to char
ptr is pointer to a one dimensional array having size five which can store data of type char
0 Comments:
Post a Comment
Your Feedback :This is Growing Site and Your Feedback is important for Us to improve the Site performance & Quality of Content.Feel Free to contact and Please Provide Name & Contact Email