References in C++

Subscribers:
50,600
Published on ● Video Link: https://www.youtube.com/watch?v=yoSEkrhmJDU



Duration: 10:56
158 views
11


References in C++ References are similar to pointers in that they directly access the memory address of an object. However, unlike with pointer syntax, we do not need to explicitly assign a reference to a memory address. Instead, we can just assign a reference to the value itself. This way, we can modify the value without having to explicitly dereference like with a pointer. The downside however is we cannot reassign a reference so once we assign a reference, it will forever refer to that memory address. Therefore, a reference is basically a const pointer without the pointer syntax. In addition, we can declare a reference to a const. This is known as const reference, however note that this refers to the value being const, not the reference itself.

C++ Playlist:
https://www.youtube.com/playlist?list=PLnKe36F30Y4ZDNIOZ51sX25pWKQ1pkpTE

Install C++ with VS Code:
https://youtu.be/DMWD7wfhgNY

Subscribe for more coding tutorials 😄!







Tags:
c++ references
references c++
references in c++
c++ reference
reference c++
C++ reference
C++ references
references C++
references in C++
reference in c++
reference in C++
references and pointers C++
references and pointers in c++
references and pointers in C++
references pointers in C++
pointers and references in c++
pointers and references c++
pointers and references C++