Memory allocation for references
===

Read a lot of differences between `pointers` & `references`.

Here is a brief description of what i learned.

**1**. Memory is allocated when a pointer is defined. A reference however, is a name alias & hence no memory is allocated for it(`Is it correct`).

**2**. Reference is bound to be initialized at the time of definition because, a reference is implemented with a constant pointer & hence cannot be made to point to the other object.
A pointer however, is not necessary to be initialized at the time of definition & hence can also be changed to point to some other object.

**3**. A reference automatically gets de-referenced. When you write cout<<p;
It is automatically de-referenced by the compiler & treated as cout<<*p; by the compiler.

Here, p is the reference.

4. A reference to a reference is not possible.Whenever, you declare a reference to a reference, its actually the reference to the same variable.
e.g.

        int i;    
        int &r1=i;    
        int &r2=r1; <-------------------2

Compiler interprets the statement 2 as:        
           int &r2=(*r1)    
and (*r1) is nothing but the variable i itself.

A pointer to a pointer is however possible.

**5**. Array of pointer is possible while array of references is not possible(Why?).

**6**. Address of pointer is possible. Address of reference is not possible. It gives of the address of the variable.

**7**. There are situations where you are bound to use references.You cannot use pointers there.
Consider the below example:

A a=b+c;

Where a,b,c are objects of class A.
The operator '+' is overloaded as follows:

    const A& operator+(const A& o)
    {
         return A(i+o.i);
    }

See sample code here:  http://ideone.com/Q0pE1   
 
Here the reference in the argument list is used to save the memory footprints.     
You cannot use pointer in the argument list as you are bound to pass the address of object in the operator function.     
     A a=&b + &c;    
However, if pointer is used in the parameter list, then we will end up adding the addresses rather than object itself.    

**I want to know that is there any other point that i am missing?**    

**When should one go for pointer & when for reference?**