Confused about pointers

ok so i grasp the essence of pointers,but what i find really confusing is what they actually hold.
so lets say
i do this
1
2
3
  int v=10;
  int *pointV=&v;

ok.
so now pointV will print the adress of v right?
and *pointV will print the value of v which is 10.
if i add 5 to *pointV does it add 5 to v?

also if i print out &pointV it gives me the same value as if i print pointV(that is the adresss of v).
does pointV not have an adress?
---
this may confuse somebody cause of all the vs and stuff so i'm sorry
so now pointV will print the adress of v right?


Yes.

and *pointV will print the value of v which is 10.


Yes.

if i add 5 to *pointV does it add 5 to v?


Yes.

also if i print out &pointV it gives me the same value as if i print pointV(that is the adresss of v).


No it doesn't. Look closer.

does pointV not have an adress?


Yes it does.
ok so i put both of them one under the other and it gave me the exact same value except
pointV was 0x22ff28
and &pointV was 0x22ff2c
but when i deleted pointV,&pointV was back to being normal(without "c" at the end.)this is quite confusing
what does the c mean at the end
ok so i put both of them one under the other and it gave me the exact same value except
pointV was 0x22ff28
and &pointV was 0x22ff2c


Those are 2 different values.

0x22ff28 != 0x22ff2c

this is quite confusing
what does the c mean at the end


It's hexadecimal. It's a base 16 numbering system.

IE instead of going 1,2,3,4,5,6,7,8,9,10,11,12,13,14...etc
it goes 1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,10,11,12,13...etc

IE 0x10 is sixteen, not ten. and 0xC is twelve.


0x22FF2C is 4 more than 0x22FF28.
The c doesn't have a meaning. The address is a hexadecimal number the computer uses to locate memory locations.

Aceix.
ohhh alright.
thanks a lot for the replies.
i finished my 3rd year in highschool and i've never come across hexadecimal numbers before,so thats why i'm clueless
Topic archived. No new replies allowed.