Trinithis
09-05-2007, 06:02 AM
To make things clear, is the difference between pointers and references in C++ simply that:
references are just aliases for another variable, in that the original var and the ref have the same address
whereas pointers are data types that contain information about an address (where an object/primitive is located in memory), but multiple pointers to the same object do not necessarily have the same address for themselves?
(I come from a Java and JavaScript background.)
references are just aliases for another variable, in that the original var and the ref have the same address
whereas pointers are data types that contain information about an address (where an object/primitive is located in memory), but multiple pointers to the same object do not necessarily have the same address for themselves?
(I come from a Java and JavaScript background.)