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
7af44a9ea8
commit
cfb84211d0
@ -10,7 +10,7 @@ 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.
|
||||
|
||||
@ -63,7 +63,7 @@ Passing via usual way(by value) will create a copy of the large variable.
|
||||

|
||||
|
||||
But now we will pass the address of a variable and use the mechanism to avoid a copy of the large variable.
|
||||

|
||||

|
||||
|
||||
So basically, we are passing values indirectly using just the address of a variable.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user