In C, the memory is byte addressable, also interpretation of char is byte. A char is consist of one byte and for example int is consist of four bytes so char x;
then &x;
is address of char not bit/byte. if youe take int i
then &i
is address of int object. we are refreshing variable/ complete object.
In memory address scheme is like, each bytes are memorized(address stored).
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+----+----+----+---+---+----+----+----+----+----+----+---+---+----+----+----+
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 0 | 1 | 1 | 2 | 3 | 4 | 5 | 6 |
+----+----+----+---+---+----+----+----+----+----+----+---+---+----+----+----+
^ ^
| |
+----+----+ | |
| add1 |--| |
+----+----+ |
| add2 |-----------------------------|
+----+----+
In this figure addr1
represents bit 0-7 in case of char and addr2
represents bit 8-15.
I mean to say ofcouser bit can be numbered(0-15), but efficient is to access one byte at a time. and even if you need one bit information its good to read complete byte.
Have you read this question: What exactly is a C pointer if not a memory address?. If your asking about C: A pointer value can be some kind of ID or handle or a combination of several IDs
So &x
is just an reference in C. It references one byte for char
and four byte for int
Additionally,
Although memory is byte addressable but fortunately, we have access at bit level thought bitwise operator and bitwise structure.