As far as I know, References need to be declared and initialized at the same time.
I guess, its only use lies in passing arguments and in some cases Polymorphism.
Is it possible to keep a reference as a data member in a class?
If yes, when should we need that?
Please give me an example.
You would use a reference as a class member when it is an integral part of the class, without which the class cannot function, and you want to either share this part among several classes or use it polymorphically:
A reference member cannot be changed after construction, so using one makes a strong statement about how the class is meant to be used. Using regular or smart pointers offers more flexibility.