What is the difference between a reference and a pointer?
Anonymous
There are additional differences. I would not say that they are same because: 1. References cannot be null, whereas pointers can; every reference refers to some object, although it may or may not be valid. 2. A reference always identifies a valid object in the memory. 3. References cannot be uninitialized. Because it is impossible to reinitialize a reference, they must be initialized as soon as they are created. In particular, local and global variables must be initialized where they are defined and references which are data members of class instances must be initialized in the class's constructor. 4. Once a reference is created, it cannot be later made to reference another object; we can say it cannot be reseated. This is often done with pointers.
Check out your Company Bowl for anonymous work chats.