Right Click to Search

Sunday, January 10, 2025

Meaning of (++*ptr)


Meaning of  (++*ptr) :

Consider the Following Example :

int n = 20 , *ptr ;
ptr = &n;
printf("%d",++*ptr);

Explanation :
  1. '++' and '*' both have Equal Precedence 
  2. Associativity is from Right to Left ( Expression evaluated from R->L)
  3. Both are Unary (Operates on single operand )
  4. So ' * ' is Performed First then ' ++ '




Calculation of Answer :
  1. ++*ptr  =  ++ ( *ptr )
  2.              =  ++ ( *3058 )
  3.              =  ++ ( 20 )
  4.              =  21



Bookmark & Share

Tags / Keywords : |

Stumble
Delicious
Technorati
Twitter
Facebook

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

 

Learn C Programming Copyright © 2010 LKart Theme is Designed by Lasantha, Free Blogger Templates