mirror of
https://github.com/dholerobin/Lecture_Notes.git
synced 2025-07-01 13:06:29 +00:00
Update Pointers_C++.md
This commit is contained in:
parent
50b8013902
commit
dc2f71f93e
@ -10,11 +10,11 @@ let's see how it looks like in computer memory.
|
||||
|
||||
The smallest unit of data is 1 bit, but the smallest addressable unit of memory is 1 byte(8 bits).
|
||||
|
||||

|
||||

|
||||
|
||||
Let say we are instantiating an integer, `int a = 3;`. We know that the size of an integer is 4 bytes. So, a computer will find some free 4 bytes and store its value.
|
||||
|
||||

|
||||

|
||||
|
||||
Note that, **The address of a variable means the address of its first byte.** So basically, when we read or write a variable, a computer only reads or writes some number of bytes according to the size of a variable(4 bytes in case of an integer).
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user