ptr
can be assumed to have the address 1000:2000
code:
int ptr[2];
printf("%p %p %p",&ptr+1,ptr+1,ptr);
What will be the output of above code?
What I tried:
As I don't know how to interpret/convert 1000:2000
into an address, I tried manually.
I tried this by considering ptr
's address as 10000+2000=12000
So, &ptr=12000
and &ptr+1=12000+sizeof(int)
ptr
is the address of first element being pointed, similarly ptr+1
is the second element's address
Is this right?
How can I test this?