What exactly is a variable in C++?
- by FredOverflow
The standard says
A variable is introduced by the declaration of an object. The variable's name denotes the object.
But what does this definition actually mean? Does a variable give a name to an object, i.e. are variables just a naming mechanism for otherwise anonymous objects? Or is a variable the name itself? Or is a variable a named object in the sense that every variable is also an object? Or is a variable just a "proxy" with a name that "delegates" all operations to the real object?
To confuse things further, many C++ books seem to treat variables and objects as synonyms.
What is your take on this?