A Tour of C++ 1.9: 하드웨어 매핑과 포인터, 참조의 차이
The core of C++ Mapping to Hardware is that basic operations translate directly into single machine instructions, utilizing hardware resources without extra runtime overhead. Assignment operations copy values between memory cells, while pointers copy addresses to change what they point to. References, however, directly change the value of the object they refer to. This article explains the C++ memory model and the differences between pointers and references based on A Tour of C++ 1.9.
How Does C++ Code Map to Hardware and Memory?

Hardware mapping and memory model
Most of C++‘s basic operations are designed to translate into a single machine instruction. Adding two int values, for instance, typically compiles down to one integer-add instruction on most architectures. This tight correspondence is why C++ can use hardware resources almost directly, without extra runtime overhead layered on top.
Memory itself can be pictured as a sequence of contiguous cells. A pointer’s value is nothing more than the machine address of one such cell. An array builds on this same model: it’s an abstraction over a run of objects laid out back-to-back, which is exactly why knowing the address of the first element is enough to compute the location of every other element.
The rule worth internalizing first is that ordinary assignment copies a value. Executing x = y; copies whatever value y holds into x’s own memory cell — it does not make the two variables share a cell. Changing one afterward has no effect on the other. If two variables genuinely need to share state, that relationship has to be created explicitly, through a pointer or a reference.
What is the Difference Between Initialization and Assignment in C++?

Assignment vs initialization
Initialization and assignment both use the = symbol, but they do very different things in terms of memory. Initialization takes a memory cell that doesn’t yet hold a valid value and turns it into a proper object. Assignment takes a cell that already holds a valid object and overwrites its value.
int x = 1; // initialization: creates x with value 1
int y = 3; // initialization: creates y with value 3
x = y; // assignment: copies y's value (3) into x's cell (x == 3)
y = 100; // assignment: only y changes; x is still 3
After x = y;, x and y happen to hold the same value, but they remain two separate cells in memory. That’s why y = 100; leaves x untouched at 3. This independence is the defining property of plain assignment — and it’s exactly what pointers and references break out of, as the next section shows.
How Do Pointers and References Differ in C++?
Pointers and references can look similar because both let you “reach” another object, but assignment through each one touches a different thing under the hood.
int x = 2;
int y = 3;
int* p = &x; // p stores the address of x
int* q = &y; // q stores the address of y
int& r = x; // r is bound to x — an alias, not a copy
int& r2 = y; // r2 is bound to y
p = q; // pointer assignment: the address is copied; p now points to y. x is still 2
r = r2; // reference assignment: r2's value (3) is written into whatever r refers to (x). x becomes 3
Pointer assignment (p = q) copies the address value itself. As a result, p now points at y instead of x, but the memory that held x is never touched. Reference assignment (r = r2) works completely differently, because C++ has no syntax to “re-point” an existing reference — = on a reference is always interpreted as a value assignment to whatever object it already refers to. So r = r2; reads the value r2 refers to (3) and writes it into the object r refers to, which is x.
This difference traces straight back to how references come into existence. In int& r = x;, that = is not an assignment at all — it’s the initialization that binds r to x. A reference can only exist bound to an object, so declaring one without initializing it is not legal. A pointer can be initialized to nullptr or later reassigned to a different address, but once a reference is bound, it can never be made to refer to anything else.
Pointer assignment p = q | Reference assignment r = r2 | |
|---|---|---|
| What gets copied | The address (what is pointed to) | The value (the referred-to object’s content) |
| What actually changes | Where the pointer itself points | The value of the object the reference already refers to |
| Can it be re-bound? | Yes — can be reassigned to a new address | No — bound permanently at initialization |
What Are the Summary and Next Steps?
Running the checks against the code above confirms the distinctions made in this article.
- After
x = y;, executingy = 100;leavesxat 3. Assignment copies values, so the two variables stay independent. - After
p = q;,xis still 2, and bothpandqnow point toy. Pointer assignment copies an address. - After
r = r2;,xbecomes 3, whilerstill refers toxexactly as before. Reference assignment is a value write to the referred-to object.
The short version: pointer assignment changes what is being pointed to, while reference assignment changes the value of what is already being referred to. Keeping that distinction clear removes a lot of confusion later, when choosing between pointers and references for function parameters or data structures. The next — and final — section of Chapter 1 is 1.10 Advice, covered in the next article in this series.
What Are the Sources?
The contents are based on Bjarne Stroustrup’s writings and official documentation as of 2026-09-15.
- Bjarne Stroustrup, A Tour of C++ (3rd ed.), §1.9 Mapping to Hardware — The main study source for this article.
- Memory model — cppreference.com — Confirmed the model of memory as contiguous cells and the meaning of addresses in pointers.
- References — Standard C++ Foundation FAQ — Confirmed the rule that references are bound at initialization and cannot be reseated.
This article is a general explanation based on study notes from Bjarne Stroustrup, A Tour of C++ 3rd ed. §1.9 Mapping to Hardware as of 2026-09-15. Details may vary by standard, implementation, or edition.