## C reading complex pointer expression

Before We Learn How to Read Complex Array we should first know precedence and associative .

• Precedence : Operator precedence describes the order in which C reads expressions
• Associativity : Order operators of equal precedence in an expression are applied

Before Reading Article You Should know Precedence and Associative Table

 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

```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 “()”

Step 2 :

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”

Step 3 :

Assign third Priority to [].
Write 3 under []

Step 4 :

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

var disqus_config = function () {
this.page.url = PAGE_URL;  // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://programmingtutorials.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
})();

Previous Page

Next Page