reference in C++

A reference, like a pointer, stores the address of an object that is located elsewhere in memory. Unlike a pointer, a reference after it is initialized cannot be made to refer to a different object or set to null. There are two kinds of references: lvalue references which refer to a named variable and rvalue references which refer to a temporary object. The & operator signifies an lvalue reference and the && operator signifies either an rvalue reference, or a universal reference (either rvalue or lvalue) depending on the context.
There are the following differences between references and pointers.
* A pointer can be declared as void but a reference can never be void.
* The pointer variable has n-levels/multiple levels of indirection i.e. single-pointer, double-pointer, triple-pointer. Whereas, the reference variable has only one/single level of indirection.
* Reference variable cannot be rebound.
* Reference variable is an internal pointer.

References are less powerful than pointers,
* Once a reference is created, it cannot be later made to reference another object; it cannot be reset. This is often done with pointers. 
* References cannot be NULL. Pointers are often made NULL to indicate that they are not pointing to any valid thing. 
* A reference must be initialized when declared. There is no such restriction with pointers.

```
#include <iostream>

using namespace std;

int main() {
    int a1 = 0;
    int a2 = 1;
    int &b = a1;
    b = a2; // this is not reassign b to a2, but change a1 to a2;

    cout << a1 << " " << a2;
}
```