C++ pointer . I want to know about the logic -



C++ pointer . I want to know about the logic -

i have question on pointer concept not find logical reply

#include<conio.h> #include<iostream.h> void main() { int arr[10]; clrscr(); cout<<*arr+5 - *arr+3; getch(); }

even if assign arr[0]=10; (or other value)

the compiler gives reply 8 how . can not see(understand) how operator precedence , associativity solve it.

i grateful you.

because of *arr - *arr 0 , 5 + 3 8.

the result may expecting result of:

cout<<(*arr+5) - (*arr+3);

c++ pointers

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -