07-24-2023, 07:19 AM
Let us assume,
int *p;
int a = 100;
p = &a;
What will the following code actually do and how?
p++;
++p;
++*p;
++(*p);
++*(p);
*p++;
(*p)++;
*(p)++;
*++p;
*(++p);
I know, this is kind of messy in terms of coding, but I want to know what will actually happen when we code like this.
Note : Lets assume that the address of `a=5120300`, it is stored in pointer `p` whose address is `3560200`. Now, what will be the value of `p & a` after the execution of each statement?
int *p;
int a = 100;
p = &a;
What will the following code actually do and how?
p++;
++p;
++*p;
++(*p);
++*(p);
*p++;
(*p)++;
*(p)++;
*++p;
*(++p);
I know, this is kind of messy in terms of coding, but I want to know what will actually happen when we code like this.
Note : Lets assume that the address of `a=5120300`, it is stored in pointer `p` whose address is `3560200`. Now, what will be the value of `p & a` after the execution of each statement?