What is a reference variable in C++?

A reference is an entity that is an alias for another object.

A reference is not a variable as a variable is only introduced by the declaration of an object. An object is a region of storage and, in C++, references do not (necessarily) take up any storage.

As objects and references are distinct groups of entities in C++ so the term “reference variable” isn’t meaningful.

Leave a Comment