Basically my question is how much bytes does a single address take / have?
I mean a char
takes 1 byte on my platform and has 1 address. But an int
takes 4 bytes. How many addresses does this int
take? Does it still have only 1 address or does it have 4?
For example :
char c = 'A'; //Address at 0xdeadbeee
int i = 45846; //Address at 0xdeadbeef
int* iPtr = &i;
iPtr++; //Address at 0xdeadbef3 now
What happens with the addresses between 0xdeadbeef
and 0xdeadbef3
? Are they all reserved for i
? What happens to i when I point to 0xdeadbeee
(should be exactly one address | byte or whatever under i
) and change it's value?
Edit: for those who will still answer, I don't want to know how big an integer is. I want to know if it has also 4 addresses when taking 4 bytes of memory and what happens (if it has 4 addresses) when changing one of these addresses' value.
I hope it's clearer now.