Fundamentals · Medium · Free
For C/C++ interviews: pointer vs reference vs address-of operator.
FresherFundamentalsOOP & Language Fundamentals
Pointer vs reference (C++)
| Pointer | Reference | |
|---|---|---|
| Syntax | int* p | int& r |
| Null | Can be nullptr | Must bind to object |
| Rebind | Can point elsewhere | Cannot reseat |
& address-of gives pointer; * dereferences. References are aliases—often for parameters to avoid copy.
Java has references without pointer arithmetic—mention if interview is C++ specific.